WinWorkstation.st
author Claus Gittinger <cg@exept.de>
Sat, 19 May 2018 16:21:45 +0200
changeset 8369 512cb726b5f0
parent 8318 a3745ee87e94
child 8379 ec75c3a5c562
permissions -rw-r--r--
#BUGFIX by cg class: XftFontDescription::FCFontListParser changed: #listOfAvailableFonts fix LC_CTYPE to avoid ugly warning from fontconfig
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     1
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     2
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     3
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     5
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     6
 only in accordance with the terms of that license and with the
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     9
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    10
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    11
"
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    12
"{ Package: 'stx:libview' }"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    13
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
    14
"{ NameSpace: Smalltalk }"
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
    15
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    16
DeviceWorkstation subclass:#WinWorkstation
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    17
	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
    18
		eventTrace eventBuffer lastClipboardSequenceNumber'
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    19
	classVariableNames:'BeepDuration NativeDialogs NativeFileDialogs NativeWidgets
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    20
		NativeWidgetClassTable StandardColorValues IgnoreSysColorChanges
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    21
		IgnoreFontChanges SystemColorValues CanEndSession
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    22
		VerboseNativeDialogs'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    23
	poolDictionaries:''
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    24
	category:'Interface-Graphics'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    25
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    26
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    27
Object subclass:#AlphaBlendParameters
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    28
	instanceVariableNames:'sourceAlpha padding redMask greenMask blueMask'
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    29
	classVariableNames:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    30
	poolDictionaries:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    31
	privateIn:WinWorkstation
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    32
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    33
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    34
ByteArray variableByteSubclass:#CopyDataStructStructure
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    35
	instanceVariableNames:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    36
	classVariableNames:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    37
	poolDictionaries:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    38
	privateIn:WinWorkstation
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    39
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    40
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    41
Object subclass:#MonitorInfo
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    42
	instanceVariableNames:'screenX screenY screenW screenH workX workY workW workH isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    43
		name'
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    44
	classVariableNames:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    45
	poolDictionaries:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    46
	privateIn:WinWorkstation
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    47
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    48
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    49
DeviceHandle subclass:#PrinterDeviceContextHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    50
	instanceVariableNames:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    51
	classVariableNames:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    52
	poolDictionaries:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    53
	privateIn:WinWorkstation
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    54
!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    55
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    56
!WinWorkstation primitiveDefinitions!
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    57
%{
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
    58
#define TRACE_ALL_EVENTS      /* */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
    59
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    60
#define COUNT_RESOURCES       /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    61
#define COUNT_BMP_RESOURCES   /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    62
#define DEBUG_DELETEOBJECT    /* */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    63
#define DEBUG_DC_REUSE        /* */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    64
#define xxDEBUG_COLORIZE_WM_PAINT_RECTS1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    65
#define xxDEBUG_COLORIZE_WM_PAINT_RECTS2
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
    66
#define LOCK_DEBUG
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
    67
#define xxSTARTUP_DISPATCHTHREAD_DEBUG
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    68
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    69
#define ADJUSTWINDOW
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    70
#define ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    71
#define WIN32THREADS
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    72
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
    73
/* #define DEBUGMASK            /* */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    74
#define SET_FOCUS_IN_WINTHREAD
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    75
#define SET_CURSOR_IN_WINTHREAD
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
    76
#define DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE /* */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    77
#define xxBEEP_IN_WINTHREAD    /* */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    78
#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
    79
#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
    80
#define HANDLE_DEVICE_EVENTS
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    81
#define COMPRESS_WINDOWPOSCHANGED
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    82
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
    83
#define USE_DRAW_MUTEX
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
    84
#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
    85
#define LATE_GENERATE_EXPOSE              /* get update region from stx thread */
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    86
#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
    87
#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
    88
					  /* seems to be needed to avoid DC conflicts */
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    89
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    90
#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
    91
# 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
    92
# 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
    93
# 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
    94
# 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
    95
# define CACHE_LAST_TMP_FONT             /* */
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    96
#endif
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    97
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    98
#define CACHE_PEN
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    99
#define CACHE_BRUSH
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   100
#define CACHE_LAST_DC                   /* remember last DC in gcData */
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   101
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   102
#ifdef CACHE_PEN
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
   103
# 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
   104
# 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
   105
#else
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   106
# define NUM_PEN_CACHED       0
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   107
#endif
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   108
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   109
#ifdef CACHE_BRUSH
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
   110
# 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
   111
# 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
   112
#else
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   113
# define NUM_BRUSH_CACHED     0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   114
#endif
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   115
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   116
#if defined(NO_CLEAR_FOR_WM_PAINT)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   117
# define WM_PAINT_CLEAR_EARLY       0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   118
# define WM_PAINT_CLEAR_LATE        0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   119
#else
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
   120
# if defined(LATE_CLEAR_FOR_WM_PAINT)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   121
#  define WM_PAINT_CLEAR_EARLY       0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   122
#  define WM_PAINT_CLEAR_LATE        1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   123
# else
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   124
#  define WM_PAINT_CLEAR_EARLY       1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   125
#  define WM_PAINT_CLEAR_LATE        0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   126
# endif
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   127
#endif
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   128
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   129
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   130
#define INT WIN_INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   131
#undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   132
#define Array WIN_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   133
#undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   134
#define Number WIN_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   135
#undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   136
#define Method WIN_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   137
#undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   138
#define Point WIN_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   139
#undef Rectangle
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   140
/* #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
   141
#undef True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   142
#define True WIN_True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   143
#undef False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   144
#define False WIN_False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   145
#undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   146
#define Block WIN_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   147
#undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   148
#define Context WIN_Context
2766
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   149
#undef Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   150
#define Date WIN_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   151
#undef Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   152
#define Time WIN_Time
3119
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   153
#undef Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   154
#define Delay WIN_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   155
#undef Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   156
#define Signal WIN_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   157
#undef Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   158
#define Set WIN_Set
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   159
#undef Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   160
#define Process WIN_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   161
#undef Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   162
#define Processor WIN_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   163
#undef Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   164
#define Message WIN_Message
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   165
#undef String
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   166
#define String WIN_String
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   167
#undef Character
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   168
#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
   169
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
   170
#include <stdio.h>
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   171
#include <errno.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   172
/* #include <malloc.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   173
/* #include <math.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   174
/* #include <string.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   175
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   176
/*#include <stdarg.h>   */
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
   177
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   178
#ifdef __BORLANDC__
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   179
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   180
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   181
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   182
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   183
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   184
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   185
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   186
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   187
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   188
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   189
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   190
# 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
   191
# ifndef _WIN32_WINNT
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   192
#  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
   193
# endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   194
# include <windows.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   195
# 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
   196
# 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
   197
#  include <dbt.h>
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   198
# endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   199
# include <sys\timeb.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   200
# 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
   201
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   202
#else
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   203
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   204
# define _USERENTRY /**/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   205
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   206
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   207
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   208
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   209
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   210
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   211
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   212
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   213
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   214
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   215
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   216
# 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
   217
# ifndef _WIN32_WINNT
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   218
#  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
   219
# endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   220
# 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
   221
# 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
   222
#  include <dbt.h>
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   223
# endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   224
# include <shellapi.h>
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   225
# include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   226
#endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   227
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   228
#ifndef MAXPATH
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   229
# 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
   230
#endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   231
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   232
#include <commdlg.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   233
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   234
#include <process.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   235
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   236
#ifdef __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   237
# undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   238
# define Array __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   239
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   240
#ifdef __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   241
# undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   242
# define Number __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   243
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   244
#ifdef __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   245
# undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   246
# define Method __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   247
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   248
#ifdef __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   249
# undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   250
# define Point __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   251
#endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   252
#ifdef __DEF_Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   253
# undef Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   254
# define Rectangle __DEF_Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   255
#else
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   256
# undef Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   257
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   258
#ifdef __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   259
# undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   260
# define Block __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   261
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   262
#ifdef __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   263
# undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   264
# define Context __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   265
#endif
2766
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   266
#ifdef __DEF_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   267
# undef Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   268
# define Date __DEF_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   269
#endif
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   270
#ifdef __DEF_Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   271
# undef Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   272
# define Time __DEF_Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   273
#endif
3119
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   274
# ifdef __DEF_Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   275
#  undef Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   276
#  define Set __DEF_Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   277
# endif
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   278
# ifdef __DEF_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   279
#  undef Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   280
#  define Signal __DEF_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   281
# endif
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   282
# ifdef __DEF_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   283
#  undef Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   284
#  define Delay __DEF_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   285
# endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   286
# ifdef __DEF_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   287
#  undef Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   288
#  define Process __DEF_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   289
# endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   290
# ifdef __DEF_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   291
#  undef Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   292
#  define Processor __DEF_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   293
# endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   294
# ifdef __DEF_Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   295
#  undef Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   296
#  define Message __DEF_Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   297
# endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   298
# ifdef __DEF_String
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   299
#  undef String
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   300
#  define String __DEF_String
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   301
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   302
# ifdef __DEF_Character
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   303
#  undef Character
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   304
#  define Character __DEF_Character
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   305
# endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   306
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   307
#if 0 /* does not work, anyway */
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   308
#ifndef WM_UNICHAR
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   309
# define WM_UNICHAR                              0x0109
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   310
#endif
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   311
#ifndef UNICODE_NOCHAR
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   312
# define UNICODE_NOCHAR                          0xFFFF
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   313
#endif
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   314
#endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   315
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   316
#undef INT
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   317
#define INT STX_INT
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   318
#undef UINT
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   319
#define UINT STX_UINT
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   320
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   321
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   322
 * some defines - tired of typing ...
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
#define _HANDLEVal(o)        (HANDLE)(__MKCP(o))
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   325
#define _HBITMAPVAL(o)       (HBITMAP)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   326
#define _HWNDVal(o)          (HWND)(__MKCP(o))
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   327
#define _HDCVal(o)           (HDC)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   328
#define _HPALETTEVal(o)      (HPALETTE)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   329
#define _HCURSORVal(o)       (HCURSOR)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   330
#define _HGDIOBJVal(o)       (HGDIOBJ)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   331
#define _LOGPALETTEVal(o)    (LOGPALETTE *)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   332
#define _COLORREFVal(o)      (COLORREF)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   333
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   334
#define _GCDATA(o)           ((struct gcData *)(__MKCP(o)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   335
3498
890cfcba79a5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3497
diff changeset
   336
#define WIDECHAR unsigned short
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
   337
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   338
#ifdef LATER
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   339
  /* 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
   340
   * 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
   341
   * 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
   342
   */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   343
# define __rootDC             (HDC)(__MKCP(__INST(rootDC)))
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   344
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   345
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   346
#define ISCONNECTED         1
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   347
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   348
struct gcData {
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   349
    union {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   350
	HDC         __hDC;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   351
	struct gcData *__nextFree;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   352
    } u;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   353
    HWND        hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   354
    HBITMAP     hBitmap;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   355
    HBITMAP     save_hBitmap;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   356
    HBITMAP     hMask;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   357
    short       clipX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   358
    short       clipY;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   359
    short       clipW;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   360
    short       clipH;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   361
    char        clipping;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   362
    char        clipByChildren;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   363
    char        bkMode;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   364
    char        bitmapColorBitCount;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   365
    short       maskOrgX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   366
    short       maskOrgY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   367
    short       lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   368
    short       fontAscent;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   369
    int         lStyle;   /* is lineStyle | joinStyle | capStyle */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   370
    int         rop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   371
    int         bitbltrop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   372
    COLORREF    fgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   373
    COLORREF    bgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   374
    HFONT       hFont;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   375
    HFONT       save_hFont;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   376
    HPEN        hPen;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   377
    HPEN        save_hPen;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   378
    HBRUSH      hBrush;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   379
    HBRUSH      save_hBrush;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   380
    char        doNotCacheOrRelease;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   381
    char        reserve1;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   382
    char        reserve2;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   383
    char        reserve3;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   384
    char        reserve4;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   385
    int         reserve5;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   386
};
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   387
#define _hDC u.__hDC
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   388
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   389
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   390
 * some synthetic values
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   391
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   392
/*****************************************************************
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   393
 * EVENT DEFINITIONS
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
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   396
/* 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
   397
   to Grab requests.  Not to be confused with event names.  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   398
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   399
#define NoEventMask                     0L
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   400
#define KeyPressMask                    (1L<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   401
#define KeyReleaseMask                  (1L<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   402
#define ButtonPressMask                 (1L<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   403
#define ButtonReleaseMask               (1L<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   404
#define EnterWindowMask                 (1L<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   405
#define LeaveWindowMask                 (1L<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   406
#define PointerMotionMask               (1L<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   407
#define PointerMotionHintMask           (1L<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   408
#define Button1MotionMask               (1L<<8)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   409
#define Button2MotionMask               (1L<<9)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   410
#define Button3MotionMask               (1L<<10)
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   411
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   412
# define Button4MotionMask               (1L<<11)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   413
# define Button5MotionMask               (1L<<12)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   414
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   415
#define ButtonMotionMask                (1L<<13)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   416
#define KeymapStateMask                 (1L<<14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   417
#define ExposureMask                    (1L<<15)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   418
#define VisibilityChangeMask            (1L<<16)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   419
#define StructureNotifyMask             (1L<<17)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   420
#define ResizeRedirectMask              (1L<<18)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   421
#define SubstructureNotifyMask          (1L<<19)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   422
#define SubstructureRedirectMask        (1L<<20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   423
#define FocusChangeMask                 (1L<<21)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   424
#define PropertyChangeMask              (1L<<22)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   425
#define ColormapChangeMask              (1L<<23)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   426
#define OwnerGrabButtonMask             (1L<<24)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   427
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   428
/* 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
   429
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
   430
are reserved in the protocol for errors and replies. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   431
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   432
#define KeyPress                2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   433
#define KeyRelease              3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   434
#define ButtonPress             4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   435
#define ButtonRelease           5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   436
#define MotionNotify            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   437
#define EnterNotify             7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   438
#define LeaveNotify             8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   439
#define FocusIn                 9
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   440
#define FocusOut                10
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   441
#define KeymapNotify            11
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   442
#define Expose                  12
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   443
#define GraphicsExpose          13
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   444
#define NoExpose                14
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   445
#define VisibilityNotify        15
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   446
#define CreateNotify            16
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   447
#define DestroyNotify           17
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   448
#define UnmapNotify             18
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   449
#define MapNotify               19
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   450
#define MapRequest              20
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   451
#define ReparentNotify          21
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   452
#define ConfigureNotify         22
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   453
#define ConfigureRequest        23
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   454
#define GravityNotify           24
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   455
#define ResizeRequest           25
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   456
#define CirculateNotify         26
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   457
#define CirculateRequest        27
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   458
#define PropertyNotify          28
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   459
#define SelectionClear          29
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   460
#define SelectionRequest        30
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   461
#define SelectionNotify         31
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   462
#define ColormapNotify          32
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   463
#define ClientMessage           33
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   464
#define MappingNotify           34
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   465
#define LASTEvent               35      /* must be bigger than any event # */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   466
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   467
/* 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
   468
   state in various key-, mouse-, and button-related events. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   469
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   470
/* modifier names.  Used to build a SetModifierMapping request or
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   471
   to read a GetModifierMapping request.  These correspond to the
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   472
   masks defined above. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   473
#define ShiftMapIndex           0
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   474
#define LockMapIndex            1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   475
#define ControlMapIndex         2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   476
#define Mod1MapIndex            3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   477
#define Mod2MapIndex            4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   478
#define Mod3MapIndex            5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   479
#define Mod4MapIndex            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   480
#define Mod5MapIndex            7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   481
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   482
#define ShiftMask               (1<<ShiftMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   483
#define LockMask                (1<<LockMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   484
#define ControlMask             (1<<ControlMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   485
#define Mod1Mask                (1<<Mod1MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   486
#define Mod2Mask                (1<<Mod2MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   487
#define Mod3Mask                (1<<Mod3MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   488
#define Mod4Mask                (1<<Mod4MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   489
#define Mod5Mask                (1<<Mod5MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   490
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   491
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   492
/* 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
   493
   with button names below. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   494
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   495
#define Button1Mask            Button1MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   496
#define Button2Mask            Button2MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   497
#define Button3Mask            Button3MotionMask
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   498
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   499
# define Button4Mask            Button4MotionMask
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   500
# define Button5Mask            Button5MotionMask
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   501
#endif
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   502
#define AnyButtonMask           (Button1Mask|Button2Mask|Button3Mask)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   503
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   504
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   505
# define AnyModifier             (1<<15)  /* used in GrabButton, GrabKey */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   506
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   507
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   508
/* 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
   509
   and ButtonRelease events.  Not to be confused with button masks above.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   510
   Note that 0 is already defined above as "AnyButton".  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   511
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   512
#define Button1                 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   513
#define Button2                 2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   514
#define Button3                 3
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   515
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   516
# define Button4                 4
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   517
# define Button5                 5
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   518
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   519
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   520
#define CAPTURE_NONE     0
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   521
#define CAPTURE_IMPLICIT 7
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   522
#define CAPTURE_EXPLICIT 8
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   523
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   524
#define BK_UNDEF         0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   525
#define BK_TRANSPARENT   1
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   526
#define BK_OPAQUE        2
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   527
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   528
#define GRAVITY_NONE        0
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   529
#define GRAVITY_S           1
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   530
#define GRAVITY_SW          2
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   531
#define GRAVITY_SE          3
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   532
#define GRAVITY_N           4
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   533
#define GRAVITY_NW          5
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   534
#define GRAVITY_NE          6
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   535
#define GRAVITY_E           7
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   536
#define GRAVITY_W           8
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   537
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   538
#if 0
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   539
# define ControlMask            8
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   540
# define ShiftMask              16
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   541
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   542
#define LeftAltMask            Mod1Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   543
#define RightAltMask           Mod2Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   544
#define TRANSLATED_KEY         Mod5Mask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   545
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   546
#define WIN32PADDING 32
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   547
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   548
/*
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   549
 * synthetic events
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
#define __WM_MOUSEENTER        0x10001
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   552
#define __WM_MOUSELEAVE        0x10002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   553
#define __WM_GEXPOSE           0x10003
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   554
#define __WM_NOGEXPOSE         0x10004
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   555
#define __WM_ICONIFIED         0x10005
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
   556
#define __WM_PAINT             0x10006
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   557
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   558
static int AltMask = RightAltMask;
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   559
static int MetaMask = LeftAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   560
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   561
#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
   562
#define BlackPixel     RGB(0, 0, 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   563
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   564
/* #undef DEBUG /* */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   565
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   566
#ifdef DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   567
# define PRINTF(x)              { console_printf x;}
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   568
# define CPRINTF(x)             { if (__debug__ % 1) console_printf x;}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   569
# define RESPRINTF(x)           /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   570
# define RES1PRINTF(x)          /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   571
# define RES_BMP_PRINTF(x)      /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   572
# define TH_DPRINTF(x)          /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   573
# define DPRINTF(x)             { if (__debug__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   574
# define NDPRINTF(x)            { if (__debugNative__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   575
# define NDPRINTF2(x)           { if (__debugNative__ > 1) console_printf x;}
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   576
# define DDPRINTF(x)            { if (__debug__ & 2) console_printf x;}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   577
# 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
   578
# define DDDDPRINTF(x)          { if (__debug__ & 16) console_printf x;}
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   579
# define BMDPRINTF(x)           { if (__debug__ & 2) console_printf x;}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   580
# define EVENT_PRINTF(x)        { if (__debug__ & 8) console_printf x;}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   581
# define EVENT_PRINTF2(x)       { if (__debug__ & 4) console_printf x;}
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   582
# define EVENT_PRINTF3(x)       /* */
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   583
# define DPRINTFIF(flag, x)                 { if (flag) console_printf x;}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   584
# define EVENT_PRINTFIF(flag, x)            { if (flag && __debug__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   585
# 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
   586
# 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
   587
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   588
# define PRINTF(x)              /* */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   589
# define CPRINTF(x)             /* */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   590
# define RES_BMP_PRINTF(x)      /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   591
# define RESPRINTF(x)           /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   592
# define RES1PRINTF(x)          /* */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   593
# define TH_DPRINTF(x)          /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   594
# define DPRINTF(x)             /* */
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   595
# define NDPRINTF(x)            /* */
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
   596
# define NDPRINTF2(x)           /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   597
# define DDPRINTF(x)            /* */
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   598
# define DDDPRINTF(x)           /* */
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
   599
# define DDDDPRINTF(x)          /* */
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
   600
# define BMDPRINTF(x)           /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   601
# define EVENT_PRINTF(x)        /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   602
# define EVENT_PRINTF2(x)       /* */
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   603
# define EVENT_PRINTF3(x)       /* */
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   604
# define DPRINTFIF(flag, x)             /* */
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   605
# define EVENT_PRINTFIF(flag, x)        /* */
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   606
# define UNHANDLED_EVENT_PRINTF(x)      /* */
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   607
# define UNHANDLED_EVENT_PRINTFIF(flag, x)    /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   608
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   609
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   610
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
   611
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
   612
/* # define EVENT_PRINTF(x)        { printf x;} */
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
   613
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   614
#define INFOFPRINTF(__x__)                 \
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   615
    if (@global(InfoPrinting) == true) { \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   616
	console_fprintf __x__;           \
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   617
    }
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   618
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   619
#define DEBUGFPRINTF(__x__)                 \
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   620
    if (@global(InfoPrinting) == true) { \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   621
	console_fprintf __x__;           \
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   622
    }
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   623
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   624
#define BR_SOLID       0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   625
#define BR_PATTERN     1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   626
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   627
#define LINE_SOLID     0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   628
#define LINE_DASH      1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   629
#define LINE_DDASH     2
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   630
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   631
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   632
# define _C_ARROW       1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   633
# define _C_CROSS       2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   634
# define _C_IBEAM       3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   635
# define _C_ICON        4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   636
# define _C_NO          5
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   637
# define _C_SIZE        6
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   638
# define _C_SIZEALL     7
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   639
# define _C_SIZENESW    8
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   640
# define _C_SIZENS      9
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   641
# define _C_SIZENWSE    10
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   642
# define _C_UPARROW     11
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   643
# define _C_WAIT        12
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   644
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   645
 static HCURSOR H_C_ARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   646
 static HCURSOR H_C_CROSS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   647
 static HCURSOR H_C_IBEAM = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   648
 static HCURSOR H_C_ICON = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   649
 static HCURSOR H_C_NO = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   650
 static HCURSOR H_C_SIZE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   651
 static HCURSOR H_C_SIZEALL = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   652
 static HCURSOR H_C_SIZENESW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   653
 static HCURSOR H_C_SIZENS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   654
 static HCURSOR H_C_SIZENWSE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   655
 static HCURSOR H_C_UPARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   656
 static HCURSOR H_C_WAIT = (HCURSOR)0;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
   657
 static HCURSOR H_C_APPSTARTING = (HCURSOR)0;
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   658
#endif /* KEEP_STD_CURSORS */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   659
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   660
#ifdef EXIT_WITH_3_CTRL_Cs
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   661
static int ctrl_c_count = 0;            /* CTRL-C count */
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   662
#endif
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   663
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   664
static int escape_count = 0;            /* ESCAPE count */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   665
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   666
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   667
static int evRootX, evRootY;
4476
4ba4a3ac09bc fix: double click in popup windows (affects ExtendedComboBox)
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
   668
static int multiClickCount = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   669
static UINT lastMSGTime;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   670
static UINT lastMouseWheelTime = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   671
static int lastClickX, lastClickY;
3584
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
   672
static int lastMotionX = -9999, lastMotionY = -9999;
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
   673
static HWND lastMotionWnd = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   674
static int deltaDoubleClickX = -999;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   675
static int deltaDoubleClickY = -999;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   676
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
   677
static OBJ lastButton = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   678
static int inSizeMove = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   679
static int inSize = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   680
static int inMove = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   681
static HWND needDelayedMouseLeaveWindow = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   682
static HWND needDelayedMouseEnterWindow = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   683
static int delayedMouseEnterX, delayedMouseEnterY;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   684
static int destroyWin;
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   685
static HDC   __tmpDC;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   686
#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
   687
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
   688
#endif
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   689
static int __logPixelSY;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   690
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   691
static int __isWinXP = 0;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   692
static int __isWin2k = 0;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   693
static int __isWinVista = 0;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   694
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   695
#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
   696
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
   697
static int            lastGcOwnerThreadID = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   698
static HWND           lastGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   699
static HBITMAP        lastGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   700
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   701
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   702
#ifndef __rootDC
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   703
 static HDC __rootDC;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   704
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   705
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   706
#ifdef CACHE_PEN
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   707
static struct __penCache {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   708
    HPEN            pen;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
   709
    unsigned int    clr;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   710
} __penCache[NUM_PEN_CACHED];
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   711
#endif
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   712
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   713
#ifdef CACHE_BRUSH
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   714
static struct __brushCache {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   715
    HBRUSH          brush;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
   716
    unsigned int    clr;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   717
} __brushCache[NUM_BRUSH_CACHED];
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   718
#endif
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   719
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   720
/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   721
 * globally cached - never released
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
static HPEN __blackPen = 0;
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   724
static HPEN __whitePen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   725
static HPEN __nullPen = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   726
static HBRUSH __blackBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   727
static HBRUSH __whiteBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   728
2620
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   729
static HPEN __bgPen = 0;
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   730
static int __bgPenColor = 0;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   731
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   732
#define WM_THREAD_CREATEWINDOW     (WM_USER + 0x101)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   733
#define WM_THREAD_DESTROYWINDOW    (WM_USER + 0x102)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   734
#define WM_THREAD_SETFOCUS         (WM_USER + 0x103)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   735
#define WM_THREAD_SETCAPTURE       (WM_USER + 0x104)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   736
#define WM_THREAD_SETCURSOR        (WM_USER + 0x105)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   737
#define WM_THREAD_BEEP             (WM_USER + 0x106)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   738
#define WM_THREAD_REGISTERHOTKEY   (WM_USER + 0x107)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   739
#define WM_THREAD_UNREGISTERHOTKEY (WM_USER + 0x108)
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   740
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   741
#define WM_TRAY_MESSAGE          (WM_USER + 0x200)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   742
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   743
#define hasEventQueued() (eventQueueHead != NULL)
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
   744
#define EVENT_THREAD_STACKSIZE  (4096*10)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   745
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   746
typedef int (*intf)(int);
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
/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   749
 * 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
   750
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   751
#define LI_TOPWIN       0x0001
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   752
#define LI_INPUTWIN     0x0002
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
   753
#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
   754
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   755
typedef struct {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   756
	HCURSOR         hCursor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   757
	HBRUSH          viewBgBrush;  /* if that is nil, it has a solid bg color */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   758
	COLORREF        viewBgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   759
	int             eventMask;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   760
	short           flag;         /* LI_ - flags bits */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   761
	short           minWidth;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   762
	short           maxWidth;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   763
	short           minHeight;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   764
	short           maxHeight;
6494
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   765
	short           currentMonitorWidth;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   766
	short           currentMonitorHeight;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   767
	short           bw;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   768
	unsigned char   iconified;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   769
	unsigned char   viewGravity;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   770
	unsigned char   unmapping;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   771
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   772
	short           bgOffsX;      /* bg-pattern offset */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   773
	short           bgOffsY;      /* bg-pattern offset */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   774
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   775
	short           mouseX;       /* last mouseX */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   776
	short           mouseY;       /* last mouseY */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   777
	COLORREF        bdColor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   778
} localWindowInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   779
typedef localWindowInfo *plocalWindowInfo;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   780
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   781
typedef struct createWindowInfo {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   782
	localWindowInfo *localWindowInfo;  /* in param */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   783
	HANDLE          newWinHandle;      /* out param */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   784
	wchar_t         *windowName;       /* in params */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   785
	wchar_t         *className;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   786
	int             winStyleBits;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   787
	int             winStyleBitsEx;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   788
	HANDLE          parentHandle;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   789
	int             x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   790
	int             y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   791
	int             dx;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   792
	int             dy;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   793
	HANDLE          hCreateEvent;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   794
	short           infoWasRead;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   795
	unsigned short  sequenceNr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   796
	unsigned        errCode;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   797
} createWindowInfo;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   798
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   799
#define INVALIDATED_CWI 0xFFFF             /* seqNr for invalidated CWI */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   800
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   801
static createWindowInfo *pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   802
static unsigned short pendingSequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   803
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   804
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   805
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   806
#ifdef _WIN64
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
# define GWL_LOCALINFO  GWLP_USERDATA
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 SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   811
	SetWindowLongPtr(__hWnd__, GWL_LOCALINFO , (LONG_PTR)__ptr__)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   812
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   813
# define GETLOCALWINDOWINFOPTR(__hWnd__) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   814
	((localWindowInfo *)GetWindowLongPtr(__hWnd__, GWL_LOCALINFO))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   815
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   816
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   817
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   818
# define GWL_LOCALINFO  GWL_USERDATA
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   819
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   820
# define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   821
	SetWindowLong(__hWnd__, GWL_LOCALINFO , (DWORD)__ptr__)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   822
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   823
# define GETLOCALWINDOWINFOPTR(__hWnd__) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   824
	((localWindowInfo *)GetWindowLong(__hWnd__, GWL_LOCALINFO))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   825
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   826
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   827
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   828
#define SetWindow_Cursor(__hWnd__, __hCurs__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   829
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   830
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   831
#define GetWindow_Cursor(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   832
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   833
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   834
#define SetWindow_viewBgColor(__hWnd__, __viewBgColor__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   835
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor = __viewBgColor__) : 0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   836
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   837
#define GetWindow_viewBgColor(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   838
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor : 0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   839
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   840
#define SetWindow_bdColor(__hWnd__, __bdColor__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   841
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bdColor = __bdColor__) : 0)
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   842
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   843
#define GetWindow_bdColor(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   844
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bdColor : 0)
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   845
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   846
#define SetWindow_iconified(__hWnd__, __iconified__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   847
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->iconified = __iconified__) : 0)
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   848
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   849
#define GetWindow_iconified(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   850
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->iconified : 0)
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   851
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   852
#define SetWindow_unmapping(__hWnd__, __unmapping__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   853
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->unmapping = __unmapping__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   854
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   855
#define GetWindow_unmapping(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   856
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->unmapping : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   857
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   858
#define SetWindow_mouseX(__hWnd__, __mouseX__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   859
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->mouseX = __mouseX__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   860
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   861
#define GetWindow_mouseX(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   862
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->mouseX : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   863
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   864
#define SetWindow_mouseY(__hWnd__, __mouseY__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   865
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->mouseY = __mouseY__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   866
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   867
#define GetWindow_mouseY(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   868
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->mouseY : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   869
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   870
#define SetWindow_mouseXY(__hWnd__, __mouseX__, __mouseY__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   871
	{ SetWindow_mouseX(__hWnd__, __mouseX__); SetWindow_mouseY(__hWnd__, __mouseY__); }
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   872
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   873
#define SetWindow_viewBgBrush(__hWnd__, __viewBgBrush__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   874
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush = __viewBgBrush__) : (HBRUSH)0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   875
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   876
#define GetWindow_viewBgBrush(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   877
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush : (HBRUSH)0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   878
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   879
#define SetWindow_bw(__hWnd__, __bw__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   880
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bw = __bw__) : 0)
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   881
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   882
#define GetWindow_bw(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   883
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bw : 0)
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   884
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   885
#define GetWindow_paintInfoPtr(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   886
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   887
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   888
#define SetWindow_flag(__hWnd__, __flag__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   889
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   890
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   891
#define GetWindow_flag(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   892
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   893
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   894
#define GetWindow_eventMask(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   895
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   896
6494
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   897
#define SetWindow_currentMonitorWidth(__hWnd__, __width__) \
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   898
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->currentMonitorWidth = __width__) : 0)
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   899
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   900
#define SetWindow_currentMonitorHeight(__hWnd__, __height__) \
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   901
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->currentMonitorHeight = __height__) : 0)
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   902
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   903
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   904
struct queuedEvent {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   905
	struct queuedEvent     *ev_next;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   906
	int                     count;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   907
	int                     ev_flag;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   908
	HWND                    ev_hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   909
	UINT                    ev_message;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   910
	UINT                    ev_wParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   911
	INT                     ev_arg1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   912
	INT                     ev_arg2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   913
	INT                     ev_arg3;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   914
	INT                     ev_arg4;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   915
	UINT                    ev_time;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   916
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   917
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   918
#define ev_x    ev_arg1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   919
#define ev_y    ev_arg2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   920
#define ev_w    ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   921
#define ev_h    ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   922
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   923
#define ev_keyCode   ev_wParam
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   924
#define ev_scanCode  ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   925
#define ev_modifiers ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   926
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   927
#define EV_CHUNK_CNT    10000
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   928
#define xxEV_CHUNK_CNT    1000
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   929
#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
   930
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   931
#define BITBLT_COPY             SRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   932
#define BITBLT_COPYINVERTED     NOTSRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   933
#define BITBLT_XOR              SRCINVERT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   934
#define BITBLT_AND              SRCAND
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   935
#define BITBLT_OR               SRCPAINT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   936
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
   937
typedef struct registerHotKeyInfo {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   938
	HANDLE       hwnd;          /* in param */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   939
	int          hotKeyId;      /* in param */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   940
	unsigned int modifier;      /* in param */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   941
	unsigned int virtualKey;    /* in params */
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
   942
} registerHotKeyInfo;
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
   943
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   944
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   945
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   946
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   947
!WinWorkstation primitiveVariables!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   948
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   949
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   950
static int firstInstance = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   951
static char *app_name = "ST/X";
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   952
static char *app_nameRoot = "ST/X:Root";
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   953
static char *app_namePopup = "ST/X:Popup";
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   954
static char *app_nameDialog = "ST/X:Dialog";
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   955
static wchar_t wapp_name[] = { 'S','T','/','X',0 };
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   956
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
   957
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
   958
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
   959
static int __debug__ = 0;
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
   960
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
   961
static int __debug_WM_ALL__ = 0;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   962
static int __debug_WM_MOUSEENTER__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   963
static int __debug_WM_MOUSELEAVE__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   964
static int __debug_WM_MOUSEMOVE__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   965
static int __debug_WM_MOUSEACTIVATE__ = 0;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   966
static int __debug_WM_CHAR__ = 0;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   967
static int __debug_WM_KEYUP__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   968
static int __debug_WM_KEYDOWN__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   969
static int __debug_WM_BUTTONUP__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   970
static int __debug_WM_BUTTONDOWN__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   971
static int __debug_WM_PAINT__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   972
static int __debug_WM_MOVING__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   973
static int __debug_WM_ERASEBKGND__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   974
static int __debug_WM_SETTEXT__ = 0;
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   975
static int __debug_WM_CTLCOLORSCROLLBAR__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   976
static int __debug_WM_GETICON__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   977
static int __debug_WM_EXPOSE__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   978
static int __debug_WM_SIZE__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   979
static int __debug_WM_WINDOWPOSCHANGING__ = 0;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
   980
static int __debug_WM_COPYDATA__ = 0;
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   981
static int __debug_WM_DROPFILES__ = 0;
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   982
static int __debug_WM_SHOWWINDOW__ = 0;
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   983
static int __debug_WM_SETCURSOR__ = 0;
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   984
static int __debug_WM_FOCUS__ = 0;
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   985
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   986
static int __debugNative__ = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   987
static int __depth;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   988
static int __realDepth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   989
static HWND __rootWin = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   990
static HWND __rootWinSpezial = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   991
#if 0
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   992
static HDESK __rootDesk;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   993
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   994
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   995
static int __activateOnClick = 1;
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   996
static int __focusFollowsMouse = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   997
static int __eatingMouseEvents = 0;
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   998
static int __ignoreButtonPressOnActivate = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   999
static int __rightButtonIsLowerWindow = 1;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1000
static int __shiftedLeftButtonIsLowerWindow = 1;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1001
static int __currentCapture = CAPTURE_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1002
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1003
static HANDLE __currentPointerView = (HANDLE)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1004
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1005
/* MessageDispatchThread */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1006
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1007
#ifndef WIN32THREADS
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1008
static HANDLE _masterThread = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1009
#endif
4443
96e956cf9acf plugin stuff now in librun
Claus Gittinger <cg@exept.de>
parents: 4441
diff changeset
  1010
static DWORD _masterThreadId = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1011
static DWORD _dispatchThreadId = 0;
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  1012
static DWORD _dispatchThreadId2 = 0;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1013
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1014
static int lockCountEvents = 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1015
#endif
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1016
static HANDLE hEventsMutex = NULL;
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1017
static char *hEventsMutexOwner = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1018
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  1019
#ifdef USE_PAINT_MUTEX
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1020
static HANDLE hPaintMutex = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1021
# define AQUIRE_PAINT_MUTEX    { WaitForSingleObject(hPaintMutex, 100L); }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1022
# define RELEASE_PAINT_MUTEX   { ReleaseMutex(hPaintMutex);              }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1023
#else
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1024
# define AQUIRE_PAINT_MUTEX    { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1025
# define RELEASE_PAINT_MUTEX   { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1026
#endif
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1027
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1028
#ifdef USE_DRAW_MUTEX
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1029
static HANDLE hDrawMutex = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1030
# define AQUIRE_DRAW_MUTEX     { WaitForSingleObject(hDrawMutex, 100L);  }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1031
# define RELEASE_DRAW_MUTEX    { ReleaseMutex(hDrawMutex);  }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1032
#else
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1033
# define AQUIRE_DRAW_MUTEX     { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1034
# define RELEASE_DRAW_MUTEX    { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1035
#endif
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1036
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1037
static HANDLE hCreateEvent = NULL;
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1038
static HANDLE hNeverTriggered = NULL;
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1039
static HANDLE hInputEvent = NULL;
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  1040
static HANDLE hDispatchThreadRunningEvent = NULL;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1041
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1042
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1043
 static int __cnt_gcData;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1044
 static int __cnt_createWindows;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1045
 static int __cnt_cur;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1046
 static int __cnt_font;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1047
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1048
#ifdef COUNT_BMP_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1049
 static int __cnt_bitmap;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1050
#endif
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1051
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1052
static struct queuedEvent *eventFreeList  = (struct queuedEvent *) 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1053
static struct queuedEvent *eventQueueHead = (struct queuedEvent *) 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1054
static struct queuedEvent *eventQueueTail = (struct queuedEvent *) 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1055
static int eventsendcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1056
static int eventempfcount = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1057
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1058
/*
2754
21cbbc8fbe09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
  1059
 * 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
  1060
 * (away from free/malloc)
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1061
 */
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  1062
#define xNUM_FREE_GC     50
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  1063
#define NUM_FREE_GC     150
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1064
static struct gcData *gcDataFreeList = (struct gcData *)0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1065
static int gcDataNumFree = 0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1066
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1067
/*
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1068
 * remember the last background-paint brush
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1069
 * will be reused by next bg-paint, if it needs
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1070
 * the same color. Otherwise, the next bg-erase
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1071
 * will destroy this brush.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1072
 */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1073
#ifdef CACHE_LAST_WM_PAINT_BRUSH
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1074
 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
  1075
 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
  1076
#endif
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1077
#ifdef CACHE_LAST_WM_PAINT_DC
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1078
 static HWND last_wm_paint_win = 0;
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1079
 static HDC  last_wm_paint_dc = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1080
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1081
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1082
#ifdef COMPRESS_WINDOWPOSCHANGED
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1083
 static HWND lastPos_win = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1084
 static int lastPos_w;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1085
 static int lastPos_h;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1086
 static int lastPos_x;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1087
 static int lastPos_y;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1088
#endif
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1089
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1090
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1091
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1092
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1093
!WinWorkstation primitiveFunctions!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1094
%{
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1095
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1096
extern HANDLE __getHInstance();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1097
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
  1098
static void __debugEvent__() {}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1099
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1100
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1101
static void
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1102
printMask(int mask) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1103
	if (mask & KeyPressMask)        console_printf("KeyPressMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1104
	if (mask & KeyReleaseMask)      console_printf("KeyReleaseMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1105
	if (mask & ButtonPressMask)     console_printf("ButtonPressMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1106
	if (mask & ButtonReleaseMask)   console_printf("ButtonReleaseMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1107
	if (mask & ButtonMotionMask)    console_printf("ButtonMotionMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1108
	if (mask & PointerMotionMask)   console_printf("PointerMotionMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1109
	if (mask & ExposureMask)        console_printf("ExposureMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1110
	if (mask & FocusChangeMask)     console_printf("FocusChangeMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1111
	if (mask & EnterWindowMask)     console_printf("EnterWindowMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1112
	if (mask & LeaveWindowMask)     console_printf("LeaveWindowMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1113
	if (mask & KeymapStateMask)     console_printf("KeymapStateMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1114
	if (mask & VisibilityChangeMask)console_printf("VisibilityChangeMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1115
	if (mask & StructureNotifyMask) console_printf("StructureNotifyMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1116
	if (mask & ResizeRedirectMask)  console_printf("ResizeRedirectMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1117
	if (mask & PropertyChangeMask)  console_printf("PropertyChangeMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1118
	if (mask & ColormapChangeMask)  console_printf("ColormapChangeMask\n");
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1119
}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1120
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1121
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1122
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1123
st2RGB(int color, struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1124
{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1125
	if (gcData && gcData->bitmapColorBitCount == 1) {
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1126
	    return (color ? WhitePixel : BlackPixel);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1127
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1128
#ifdef ALWAYSTRUECOLOR
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1129
	return (color & 0xffffff);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1130
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1131
	if (__depth < 15) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1132
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1133
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1134
	    if ((__depth == 16) || (__depth == 15)) {
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1135
		int ib = (color & 0x1f) << 3;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1136
		int ig = ((color >> 5) & 0x3f) << 2;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1137
		int ir = ((color >> 11) & 0x1f) << 3;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1138
		ir |= 7;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1139
		ig |= 3;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1140
		ib |= 7;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1141
		return RGB(ir,ig,ib);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1142
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1143
	    return (color & 0xffffff);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1144
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1145
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1146
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1147
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1148
static int
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1149
RGB2st(int r, int g, int b)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1150
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1151
	int ir,ig,ib,id;
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
  1152
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1153
#ifdef ALWAYSTRUECOLOR
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1154
	ir = (r >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1155
	ig = (g >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1156
	ib = (b >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1157
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1158
	id = RGB( ir, ig, ib);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1159
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1160
	if (__depth < 15) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1161
	    id = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1162
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1163
	    if ((__depth == 16) || (__depth == 15)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1164
		ir = (r >> 11) & 0x1f;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1165
		ig = (g >> 10) & 0x3f;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1166
		ib = (b >> 11) & 0x1f;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1167
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1168
		id = ( ir << 11 ) | ( ig << 5 ) | ib;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1169
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1170
		ir = (r >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1171
		ig = (g >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1172
		ib = (b >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1173
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1174
		id = RGB( ir, ig, ib);
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
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1177
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1178
	return id;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1179
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1180
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1181
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1182
/*
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1183
 * return a windows top-window
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
static HWND
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1186
GetTopParent(HWND hwnd)
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1187
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1188
	HWND lastParent = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1189
	HWND nextParent;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1190
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1191
	while (nextParent = GetParent(lastParent)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1192
	    lastParent = nextParent;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1193
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1194
	return lastParent;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1195
}
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1196
#endif
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1197
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1198
#ifdef DEBUG_DELETEOBJECT
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1199
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1200
static int
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1201
_DeleteObject(HANDLE o, int lineNr)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1202
{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1203
    int r = DeleteObject(o);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1204
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1205
    if (r == 0)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1206
	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
  1207
    return r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1208
}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1209
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1210
#else
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1211
# define _DeleteObject(o,lnr)  DeleteObject(o)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1212
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1213
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1214
static void
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1215
_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
  1216
{
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1217
#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
  1218
    if (f == __tmpDC_hfont) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1219
	SelectObject(__tmpDC, __tmpDC_prev_hfont);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1220
	__tmpDC_hfont = NULL;
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1221
    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1222
#endif
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1223
    _DeleteObject(f, lineNr);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1224
}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1225
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1226
static int
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1227
_DeleteBrush(HBRUSH br, int lineNr)
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1228
{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1229
    if ((br != __whiteBrush) && (br != __blackBrush)) {
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1230
	int r = DeleteObject(br);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1231
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1232
	if (r == 0)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1233
	    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
  1234
	return r;
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1235
    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1236
    return 1;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1237
}
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1238
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1239
static int
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1240
_DeletePen(HPEN p, int lineNr)
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1241
{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1242
    if ((p != __whitePen) && (p != __blackPen)) {
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1243
	int r = DeleteObject(p);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1244
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1245
	if (r == 0)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1246
	    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
  1247
	return r;
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1248
    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1249
    return 1;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1250
}
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1251
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1252
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1253
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1254
static int
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1255
_DeletePenIfNotInCache(HPEN p, int lineNr)
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1256
{
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1257
    int i, r;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1258
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1259
    if ((p == __whitePen) || (p == __blackPen)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1260
	return 1; /* not deleted, but OK */
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1261
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1262
    for (i=0; i<NUM_PEN_CACHED;i++) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1263
	if (__penCache[i].pen == p) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1264
	    return 1; /* not deleted, but OK */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1265
	}
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1266
    }
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1267
    r = DeleteObject(p);
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1268
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1269
    if (r == 0)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1270
	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
  1271
    return r;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1272
}
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1273
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1274
#else
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1275
# define _DeletePenIfNotInCache(p, lineNr)   _DeletePen(p, lineNr)
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1276
#endif /* CACHE_PEN */
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1277
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1278
#ifdef CACHE_BRUSH
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1279
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1280
static int
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1281
_DeleteBrushIfNotInCache(HBRUSH br, int lineNr)
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1282
{
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1283
    int i, r;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1284
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1285
    for (i=0; i<NUM_BRUSH_CACHED;i++) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1286
	if (__brushCache[i].brush == br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1287
	    return 1; /* not deleted, but OK */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1288
	}
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1289
    }
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1290
    if ((br == __whiteBrush) || (br == __blackBrush)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1291
	return 1; /* not deleted, but OK */
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1292
    }
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1293
    r = DeleteObject(br);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1294
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1295
    if (r == 0)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1296
	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
  1297
    return r;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1298
}
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1299
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1300
#else
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1301
# define _DeleteBrushIfNotInCache(br, lineNr)   _DeleteBrush(br, lineNr)
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1302
#endif /* CACHE_BRUSH */
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1303
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1304
static struct gcData *
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
  1305
newGcData(void)
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1306
{
5575
Stefan Vogel <sv@exept.de>
parents: 5574
diff changeset
  1307
    struct gcData *gcData;
Stefan Vogel <sv@exept.de>
parents: 5574
diff changeset
  1308
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1309
    if (gcDataFreeList) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1310
	gcData = gcDataFreeList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1311
	gcDataFreeList = gcData->u.__nextFree;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1312
	gcDataNumFree--;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1313
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1314
	gcData = (struct gcData *) malloc(sizeof(struct gcData));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1315
	if (! gcData) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1316
	    console_fprintf(stderr, "WinWorkstat [warning]: failed to allocate gcData\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1317
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1318
	}
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1319
    }
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1320
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1321
    memset(gcData, 0, sizeof(struct gcData));
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  1322
    gcData->fgColor = 0xffffff;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1323
    /* gcData->bgColor = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1324
    gcData->clipping = FALSE;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1325
    gcData->clipByChildren = TRUE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1326
    gcData->bitbltrop2 = BITBLT_COPY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1327
    gcData->lineWidth = 1;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1328
    gcData->lStyle = PS_SOLID | PS_JOIN_MITER | PS_ENDCAP_FLAT;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1329
    /* 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
  1330
    /* 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
  1331
    /* gcData->hBrush = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1332
    return gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1333
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1334
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1335
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1336
freeGcData(struct gcData *gcData)
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1337
{
2754
21cbbc8fbe09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
  1338
    if (gcDataNumFree < NUM_FREE_GC) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1339
	gcData->u.__nextFree = gcDataFreeList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1340
	gcDataFreeList = gcData;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1341
	gcDataNumFree++;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1342
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1343
	free(gcData);
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1344
    }
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1345
}
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1346
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1347
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1348
# 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
  1349
    if (lastGcData == __gcData__) {  \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1350
	_releaseDC(lastGcData);      \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1351
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1352
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1353
# 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
  1354
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1355
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1356
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1357
# 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
  1358
    if (__gcData__->hPen) {           \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1359
	if (__gcData__->save_hPen) {  \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1360
	    SelectObject(__gcData__->_hDC, __gcData__->save_hPen); \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1361
	    __gcData__->save_hPen = 0;   \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1362
	} \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1363
	_DeletePenIfNotInCache(__gcData__->hPen, __LINE__); \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1364
	__gcData__->hPen = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1365
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1366
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1367
# 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
  1368
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1370
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1371
# 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
  1372
    if (__gcData__->hBrush) {           \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1373
	if (__gcData__->save_hBrush) {  \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1374
	    SelectObject(__gcData__->_hDC, __gcData__->save_hBrush); \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1375
	    __gcData__->save_hBrush = 0;   \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1376
	} \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1377
	_DeleteBrushIfNotInCache(__gcData__->hBrush, __LINE__); \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1378
	__gcData__->hBrush = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1379
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1380
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1381
# 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
  1382
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1383
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1384
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1385
_releaseDC(struct gcData *gcData)
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1386
{
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1387
    HDC hDC = gcData->_hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1388
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1389
    if (gcData->doNotCacheOrRelease ) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1390
	return;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1391
    }
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1392
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1393
    if (gcData->save_hPen) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1394
	SelectObject(hDC, gcData->save_hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1395
	gcData->save_hPen = 0;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1396
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1397
    if (gcData->save_hBrush) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1398
	SelectObject(hDC, gcData->save_hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1399
	gcData->save_hBrush = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1400
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1401
    if (gcData->save_hFont) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1402
	SelectObject(hDC, gcData->save_hFont);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1403
	gcData->save_hFont = 0;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1404
    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1405
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1406
    if (gcData->hWnd) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1407
	if (hDC) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1408
	    ReleaseDC(gcData->hWnd, hDC);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1409
#ifdef CACHE_LAST_WM_PAINT_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1410
	    if (hDC == last_wm_paint_dc) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1411
		last_wm_paint_dc = last_wm_paint_win = 0;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  1412
# ifdef DEBUG_DC_REUSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1413
		console_fprintf(stderr, "WinWorkstation [info]: Oops - releasing bg_paint-dc\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1414
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1415
	    }
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
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1418
    } else if (gcData->hBitmap) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1419
	SelectObject(hDC, gcData->save_hBitmap);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1420
	DeleteDC(hDC);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1421
    }
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1422
    gcData->_hDC = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1423
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1424
#ifdef CACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1425
    if (lastGcData == gcData) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1426
	lastGcData = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1427
    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1428
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1429
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1430
    if (gcData->hPen) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1431
	_DeletePenIfNotInCache(gcData->hPen, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1432
	gcData->hPen = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1433
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1434
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1435
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1436
    if (gcData->hBrush) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1437
	_DeleteBrushIfNotInCache(gcData->hBrush, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1438
	gcData->hBrush = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1439
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1440
#endif
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1441
}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1442
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1443
static HDC
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1444
_getDC(struct gcData *gcData)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1445
{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1446
    HDC hDC;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1447
    int currThreadId;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1448
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1449
    if (gcData->doNotCacheOrRelease ) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1450
	return gcData->_hDC;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1451
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1452
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1453
#ifdef CACHE_LAST_DC
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1454
    currThreadId = GetCurrentThreadId();
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1455
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1456
    if (lastGcData) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1457
	if ((lastGcData == gcData)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1458
	 && (lastGcHWIN == gcData->hWnd)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1459
	 && (lastGcHBITMAP == gcData->hBitmap)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1460
	 && (lastGcOwnerThreadID == currThreadId)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1461
	 && gcData->_hDC
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1462
	) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1463
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1464
	    if (last_wm_paint_dc == gcData->_hDC) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1465
#  ifdef DEBUG_DC_REUSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1466
		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
  1467
#  endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1468
		last_wm_paint_dc = last_wm_paint_win = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1469
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1470
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1471
	    return gcData->_hDC;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1472
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1473
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1474
	_releaseDC(lastGcData);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1475
	lastGcData = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1476
    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1477
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1478
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1479
    hDC = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1480
    if (gcData->hWnd != 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1481
	if (gcData->hWnd == __rootWin) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1482
	    hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_WINDOW);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1483
	} else if (gcData->clipByChildren) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1484
	    //gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_CLIPCHILDREN);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1485
	    hDC = gcData->_hDC = GetDC(gcData->hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1486
	} else  {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1487
	    hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_PARENTCLIP);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1488
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1489
    } else if (gcData->hBitmap) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1490
	hDC = gcData->_hDC = CreateCompatibleDC(__tmpDC);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1491
	gcData->save_hBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1492
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1493
    gcData->bkMode = BK_UNDEF;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1494
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1495
    if (hDC) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1496
	SetTextColor(hDC, gcData->fgColor);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1497
	SetBkColor(hDC, gcData->bgColor);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1498
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1499
	if (gcData->rop2)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1500
	    SetROP2(hDC, gcData->rop2);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1501
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1502
	if (gcData->clipping) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1503
	    HRGN region = CreateRectRgn( gcData->clipX, gcData->clipY,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1504
					 gcData->clipX + gcData->clipW,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1505
					 gcData->clipY + gcData->clipH);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1506
	    if (region == NULL ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1507
		console_fprintf(stderr, "WinWorkstat [warning]: clipping region creation failed\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1508
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1509
		if (SelectClipRgn(hDC, region) == ERROR ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1510
		    DPRINTF(("WinWorkstat [warning]: select clipping region failed\n" ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1511
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1512
		_DeleteObject(region, __LINE__);
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
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1515
	    SelectClipRgn(hDC, NULL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1516
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1517
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1518
	if (gcData->hFont) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1519
	    HFONT prevFont;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1520
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1521
	    prevFont = SelectObject(hDC, gcData->hFont);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1522
	    if (! gcData->save_hFont) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1523
		gcData->save_hFont = prevFont;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1524
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1525
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1526
    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1527
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1528
#ifdef CACHE_LAST_DC
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1529
    lastGcData = gcData;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1530
    lastGcOwnerThreadID = currThreadId;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1531
    lastGcHWIN = gcData->hWnd;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1532
    lastGcHBITMAP = gcData->hBitmap;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1533
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1534
    gcData->_hDC = hDC;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1535
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1536
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1537
    if (last_wm_paint_dc == hDC) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1538
#  ifdef DEBUG_DC_REUSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1539
	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
  1540
#  endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1541
	last_wm_paint_dc = last_wm_paint_win = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1542
    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1543
# endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1544
#endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1545
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1546
    return hDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1547
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1548
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1549
static HBRUSH
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1550
GcDataGetBrush(HDC hDC, struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1551
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1552
    HBRUSH hBrush = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1553
    HBRUSH prevBrush;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1554
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1555
#ifdef CACHE_LAST_BRUSH
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1556
    if (hBrush = gcData->hBrush) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1557
	if (! gcData->save_hBrush) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1558
	    gcData->save_hBrush = SelectObject(gcData->_hDC, hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1559
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1560
	return hBrush;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1561
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1562
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1563
    if (gcData->hMask) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1564
	hBrush = CreatePatternBrush(gcData->hMask);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1565
	SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1566
	RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1567
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1568
	if (gcData->fgColor == BlackPixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1569
	    hBrush = __blackBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1570
	} else if (gcData->fgColor == WhitePixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1571
	    hBrush = __whiteBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1572
	} else {
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1573
#ifdef CACHE_BRUSH
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1574
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1575
		int i;
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
		for (i=0; i<NUM_BRUSH_CACHED; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1578
		    if (__brushCache[i].clr == gcData->fgColor) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1579
			hBrush = __brushCache[i].brush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1580
			/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1581
			 * move it up in the cache
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
			if (i > 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1584
			    HBRUSH t = __brushCache[i-1].brush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1585
			    int c = __brushCache[i-1].clr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1586
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1587
			    __brushCache[i-1].brush = hBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1588
			    __brushCache[i-1].clr = gcData->fgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1589
			    __brushCache[i].brush = t;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1590
			    __brushCache[i].clr = c;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1591
			}
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1592
# ifdef CACHE_LAST_BRUSH
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1593
			prevBrush = SelectObject(gcData->_hDC, hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1594
			if (! gcData->save_hBrush) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1595
			    gcData->save_hBrush = prevBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1596
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1597
			gcData->hBrush = hBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1598
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1599
			return hBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1600
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1601
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1602
	    }
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1603
#endif /* BRUSH_CACHE */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1604
	    hBrush = CreateSolidBrush(gcData->fgColor);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1605
	    RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1606
	}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1607
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1608
    gcData->hBrush = hBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1609
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1610
    prevBrush = SelectObject(gcData->_hDC, hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1611
    if (! gcData->save_hBrush) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1612
	gcData->save_hBrush = prevBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1613
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1614
    return hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1615
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1616
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1617
#ifdef CACHE_LAST_BRUSH
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1618
# define GcDataReleaseBrush(hDC, gcData)  /* nothing*/
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1619
#else
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1620
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1621
GcDataReleaseBrush(HDC hDC, struct gcData *gcData)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1622
{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1623
    HBRUSH hBrush = gcData->hBrush;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1624
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1625
    if (gcData->save_hBrush) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1626
	SelectObject(hDC, gcData->save_hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1627
	gcData->save_hBrush = NULL;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1628
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1629
    _DeleteBrushIfNotInCache(hBrush, __LINE__);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1630
    gcData->hBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1631
}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1632
#endif
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1633
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1634
static HPEN
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1635
GcDataGetPen(HDC hDC, struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1636
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1637
    HPEN hPen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1638
    HPEN prevPen;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1639
    LOGBRUSH Brush;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1640
    int lw;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1641
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1642
#ifdef CACHE_LAST_PEN
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1643
    if (hPen = gcData->hPen) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1644
	if (! gcData->save_hPen) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1645
	    gcData->save_hPen = SelectObject(gcData->_hDC, hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1646
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1647
	return hPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1648
    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1649
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1650
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1651
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1652
     && (gcData->hMask == 0)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1653
     && (gcData->lineWidth <= 1)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1654
	if (gcData->fgColor == BlackPixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1655
	    gcData->hPen = hPen = __blackPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1656
	    prevPen = SelectObject(hDC, hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1657
	    if (! gcData->save_hPen) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1658
		gcData->save_hPen = prevPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1659
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1660
	    return hPen;
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
	if (gcData->fgColor == WhitePixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1663
	    gcData->hPen = hPen = __whitePen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1664
	    prevPen = SelectObject(hDC, hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1665
	    if (! gcData->save_hPen) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1666
		gcData->save_hPen = prevPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1667
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1668
	    return hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1669
	}
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1670
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1671
#ifdef CACHE_PEN
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1672
	{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1673
	    int i;
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
	    for (i=0; i<NUM_PEN_CACHED; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1676
		if (__penCache[i].clr == gcData->fgColor) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1677
		    hPen = __penCache[i].pen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1678
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1679
		     * move it up in the cache
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
		    if (i > 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1682
			HPEN t = __penCache[i-1].pen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1683
			int c = __penCache[i-1].clr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1684
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1685
			__penCache[i-1].pen = hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1686
			__penCache[i-1].clr = gcData->fgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1687
			__penCache[i].pen = t;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1688
			__penCache[i].clr = c;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1689
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1690
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1691
		    gcData->hPen = hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1692
		    prevPen = SelectObject(hDC, hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1693
		    if (! gcData->save_hPen) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1694
			gcData->save_hPen = prevPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1695
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1696
		    return hPen;
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
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1699
	}
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1700
#endif /* PEN_CACHE */
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1701
    }
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1702
4149
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
  1703
    hPen = (HPEN) 0;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1704
    lw = gcData->lineWidth;
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1705
    if (lw == 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1706
	lw = 1;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1707
    }
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1708
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
     * 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
  1711
     * 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
  1712
     */
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1713
    if (gcData->hMask) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1714
	Brush.lbStyle = BS_PATTERN;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1715
	Brush.lbHatch = (ULONG_PTR)(gcData->hMask);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1716
	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
  1717
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1718
	Brush.lbStyle = BS_SOLID;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1719
	Brush.lbHatch = (ULONG_PTR)0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1720
	Brush.lbColor = gcData->fgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1721
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1722
	hPen = (HPEN) 0;
5661
52da326a0fe1 use ExtCreatePen not CreatePen search for: USE_OLD_CREATE_PEN
ca
parents: 5660
diff changeset
  1723
52da326a0fe1 use ExtCreatePen not CreatePen search for: USE_OLD_CREATE_PEN
ca
parents: 5660
diff changeset
  1724
#if USE_OLD_CREATE_PEN
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1725
	hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK), lw, gcData->fgColor);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1726
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1727
	RESPRINTF(("CreatePen %x %d(%d) %x %x\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1728
		    gcData->lStyle,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1729
		    lw, gcData->lineWidth,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1730
		    gcData->fgColor, gcData->hMask));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1731
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1732
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1733
	SetBkMode(hDC, TRANSPARENT);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1734
	gcData->bkMode = BK_TRANSPARENT;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1735
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1736
	if (! hPen) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1737
	    hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1738
			    lw, /* gcData->lineWidth, */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1739
			    &Brush,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1740
			    0, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1741
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1742
	    RESPRINTF(("ExtCreatePen1 %x %d(%d) %x %x\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1743
			gcData->lStyle,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1744
			lw, gcData->lineWidth,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1745
			gcData->fgColor, gcData->hMask));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1746
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1747
	    if (gcData->hMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1748
		SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1749
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1750
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1751
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1752
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1753
    gcData->hPen = hPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1754
    prevPen = SelectObject(hDC, hPen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1755
    if (! gcData->save_hPen) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1756
	gcData->save_hPen = prevPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1757
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1758
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1759
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1760
    /*
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1761
     * remember in penCache
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
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1764
     && (gcData->hMask == 0)
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1765
     && (gcData->lineWidth <= 1)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1766
	int i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1767
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1768
	/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1769
	 * search for an empty slot
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
	for (i=0; i<NUM_PEN_CACHED; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1772
	    if (__penCache[i].pen == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1773
		__penCache[i].clr = gcData->fgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1774
		__penCache[i].pen = hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1775
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1776
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1777
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1778
	if (i == NUM_PEN_CACHED) {
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
	     * replace last in penCache
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
	    HPEN t = __penCache[NUM_PEN_CACHED - 1].pen;
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
	    __penCache[NUM_PEN_CACHED - 1].pen = hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1785
	    __penCache[NUM_PEN_CACHED - 1].clr = gcData->fgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1786
	    _DeletePen(t, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1787
	}
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1788
    }
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1789
#endif
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1790
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1791
    return hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1792
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1793
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1794
#ifdef CACHE_LAST_PEN
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1795
# define GcDataReleasePen(HDC hDC, struct gcData *gcData)  /* nothing*/
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1796
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1797
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1798
GcDataReleasePen(HDC hDC, struct gcData *gcData)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1799
{
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1800
    HPEN hPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1801
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1802
    if (gcData->save_hPen) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1803
	SelectObject(hDC, gcData->save_hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1804
	gcData->save_hPen = NULL;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1805
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1806
    hPen = gcData->hPen;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1807
    _DeletePenIfNotInCache(hPen, __LINE__);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1808
    gcData->hPen = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1809
}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1810
#endif /* CACHE_LAST_PEN */
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1811
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1812
/* atze */
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1813
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1814
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1815
lockEvents(char *whoIsLocking)
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1816
{
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1817
    DWORD dwWaitResult = WaitForSingleObject(hEventsMutex, 5000L);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1818
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1819
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1820
    lockCountEvents++;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1821
    if (lockCountEvents != 1) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1822
	console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 1 in lock\n", lockCountEvents);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1823
	lockCountEvents = 1;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1824
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1825
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1826
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1827
    switch (dwWaitResult) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1828
	case WAIT_OBJECT_0:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1829
	    hEventsMutexOwner = whoIsLocking;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1830
	    return (TRUE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1831
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1832
	case WAIT_ABANDONED:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1833
	    console_fprintf(stderr, "WinWorkstation [warning]: lockEvent abandoned (was owned by %s)\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1834
			(hEventsMutexOwner ? hEventsMutexOwner : "NONE"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1835
	    hEventsMutexOwner = whoIsLocking;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1836
	    return (TRUE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1837
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1838
	case WAIT_TIMEOUT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1839
	    console_fprintf(stderr, "WinWorkstation [warning]: lockEvent timeout (owned by %s)\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1840
			(hEventsMutexOwner ? hEventsMutexOwner : "NONE") );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1841
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1842
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1843
	default:
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
		unsigned errCode = GetLastError();
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
		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
  1848
			    (hEventsMutexOwner ? hEventsMutexOwner : "NONE"),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1849
			    dwWaitResult, errCode );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1850
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1851
	    break;
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1852
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1853
    return (FALSE);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1854
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1855
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1856
static int
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1857
unlockEvents(void) {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1858
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1859
    lockCountEvents--;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1860
    if (lockCountEvents != 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1861
	console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 0 in unlock\n", lockCountEvents);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1862
	lockCountEvents = 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1863
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1864
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1865
    if (! ReleaseMutex(hEventsMutex)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  1866
       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
  1867
       return (FALSE);
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1868
    }
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1869
    hEventsMutexOwner = NULL;
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1870
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1871
    return (TRUE);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1872
}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1873
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
static int
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1876
initEventqueue(void) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1877
    struct queuedEvent *bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1878
    int i;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1879
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1880
    bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1881
    if (bulk == 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1882
	console_fprintf(stderr, "WinWorkstation [warning]: no memory for dispatchqueue\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1883
	return 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1884
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1885
    for (i=1; i<EV_CHUNK_CNT; i++) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1886
	bulk[i-1].ev_next = &(bulk[i]);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1887
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1888
    bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1889
    eventFreeList = bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1890
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1891
    return 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1892
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1893
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1894
#define EV_NOTIME       0
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1895
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1896
#define enqEvent(a1, a2, a3, a4, a5, a6, a7, a8, a9) \
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1897
    __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
  1898
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1899
static void
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1900
__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
  1901
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1902
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1903
    int repeatCount = 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1904
4445
c83f9aebaf41 comment
Claus Gittinger <cg@exept.de>
parents: 4444
diff changeset
  1905
    /* get an event struct
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
    while (! eventFreeList) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1908
	if (repeatCount++ >= 5) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1909
	    /* throw away sorry */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1910
	    console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1911
	    return;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1912
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1913
	console_fprintf(stderr, "WinWorkstation [warning]: wait for event memory (%d)\n", repeatCount);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1914
	WaitForSingleObject( hNeverTriggered, 100L );
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1915
    }
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1916
    if (! lockEvents("enqEvent")) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1917
	console_fprintf(stderr, "WinWorkstation [error]: event throw away (lock problem)\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1918
	return;
4363
d7a017ae1487 *** empty log message ***
penk
parents: 4353
diff changeset
  1919
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1920
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1921
    ev = eventFreeList;
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
    if (! ev) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1924
	console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1925
	unlockEvents();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1926
	return;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1927
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1928
    eventFreeList  = ev->ev_next;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1929
    ev->ev_flag    = flag;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1930
    ev->ev_hWnd    = hWnd;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1931
    ev->ev_message = message;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1932
    ev->ev_wParam  = wParam;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1933
    ev->ev_arg1    = arg1;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1934
    ev->ev_arg2    = arg2;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1935
    ev->ev_arg3    = arg3;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1936
    ev->ev_arg4    = arg4;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1937
    ev->ev_time    = evTime /* lastMSGTime */;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1938
    ev->count      = eventsendcount++;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1939
    ev->ev_next    = (struct queuedEvent *) 0;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1940
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1941
    if (eventQueueTail) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1942
	eventQueueTail->ev_next = ev;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1943
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1944
	eventQueueHead = ev;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1945
    }
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1946
    eventQueueTail = ev;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1947
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1948
    unlockEvents();
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1949
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1950
    if (eventQueueHead == ev) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1951
	SetEvent(hInputEvent);
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1952
    }
2511
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1953
2337
79f957096b99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1954
#if 0
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  1955
    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
  1956
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1957
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1958
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1959
static int
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1960
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
  1961
{
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1962
    struct queuedEvent * ev = NULL;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1963
    char * freeArg2 = NULL;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1964
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1965
    if (mask != ~0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1966
	PRINTF(("deqEvent mask:%x\n",mask));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1967
    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1968
    if (hWnd) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1969
	PRINTF(("deqEvent hWnd:%x\n",hWnd));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1970
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1971
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1972
  again:
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1973
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1974
    if (! eventQueueHead)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1975
	return (0);
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1976
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1977
    if (! lockEvents("deqEvent")) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1978
	return (0);
4363
d7a017ae1487 *** empty log message ***
penk
parents: 4353
diff changeset
  1979
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1980
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1981
    TH_DPRINTF(("TDEQ\n"));
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1982
    ev = eventQueueHead;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1983
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1984
    if (! ev) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1985
	unlockEvents();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1986
	return (0);
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1987
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1988
    eventQueueHead = ev->ev_next;
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
    if (! eventQueueHead) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1991
	eventQueueTail = (struct queuedEvent *) 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1992
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1993
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1994
    if (ev->count != -1) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1995
	static int anyGoodEventReceived = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1996
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1997
	if (eventempfcount != ev->count) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1998
	    if (anyGoodEventReceived) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1999
		console_fprintf(stderr, "WinWorkstation [warning]: lost event (eventcount error %d <-> %d)\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2000
				 eventempfcount, ev->count);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2001
	    }
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
	    anyGoodEventReceived = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2004
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2005
	    anyGoodEventReceived = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2006
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2007
	eventempfcount++;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2008
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2009
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2010
    if (ev->ev_message == WM_DESTROY) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2011
	/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2012
	 * arg2 is the localInfoPtr
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2013
	 * (which is already cleared in the wind-structure)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2014
	 * 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
  2015
	 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2016
	if (ev->ev_arg2) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2017
	    freeArg2 = (char *) ev->ev_arg2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2018
	    ev->ev_arg2 = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2019
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2020
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2021
#ifdef TOPWINDOWCLASS
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2022
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2023
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
  2024
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2025
	if (ev->ev_arg1) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2026
	    if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2027
		/*console_printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2028
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2029
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2030
		/* noch einmal in die queue
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2031
		*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2032
		if (ev->ev_arg2++ < 100) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2033
		    ev->ev_next = (struct queuedEvent *)0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2034
		    ev->count   = eventsendcount++;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2035
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2036
		    if (eventQueueTail) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2037
			eventQueueTail->ev_next = ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2038
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2039
			eventQueueHead = ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2040
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2041
		    eventQueueTail = ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2042
		    unlockEvents();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2043
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2044
		    if (freeArg2) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2045
			free (freeArg2);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2046
			freeArg2 = NULL;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2047
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2048
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2049
		    if (ev->ev_arg2 > 98) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2050
			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
  2051
			sleep(1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2052
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2053
			sleep(0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2054
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2055
		    goto again;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2056
		}
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
  2057
		/* fail evtl. später ändern und in st verzögert aufrufen
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2058
		*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2059
		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
  2060
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2061
	    free((char*)ev->ev_arg1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2062
	    ev->ev_arg1 = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2063
	}
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2064
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2065
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2066
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2067
    *ret_ev = *ev;
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
    ev->ev_next   = eventFreeList;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2070
    eventFreeList = ev;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2071
    unlockEvents();
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2072
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2073
    if (freeArg2) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2074
	free (freeArg2);
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2075
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2076
    return (1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2077
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2078
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2079
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2080
__clearRectangles(HWND hWnd, int numRects, RECT *pRect)
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2081
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2082
	HDC dc;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2083
	HBRUSH br;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2084
	int bgClr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2085
	int isPrivateBrush = 0;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2086
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2087
# ifdef CACHE_LAST_WM_PAINT_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2088
	AQUIRE_PAINT_MUTEX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2089
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2090
	if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2091
	    dc = last_wm_paint_dc;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2092
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2093
	    if (last_wm_paint_dc) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2094
#  ifdef CACHE_LAST_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2095
		if (lastGcData && (lastGcData->_hDC == last_wm_paint_dc)) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2096
#   ifdef DEBUG_DC_REUSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2097
		    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
  2098
#   endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2099
		    _releaseDC(lastGcData);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2100
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2101
		    ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2102
		}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2103
#  else
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2104
		ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2105
#  endif /* CACHE_LAST_DC */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2106
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2107
	    dc = GetDC(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2108
	    last_wm_paint_dc = dc;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2109
	    last_wm_paint_win = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2110
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2111
# else
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2112
	dc = (HDC)GetDC(hWnd);
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2113
# endif /* CACHE_LAST_WM_PAINT_DC */
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2114
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2115
# ifdef CACHE_LAST_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2116
	if (lastGcData && (lastGcData->_hDC == dc)) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2117
#  ifdef DEBUG_DC_REUSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2118
	    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
  2119
#  endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2120
	    if ((lastGcData->rop2 != R2_COPYPEN)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2121
	     || (lastGcData->bitbltrop2 != BITBLT_COPY)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2122
		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
  2123
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2124
	    lastGcData = 0;
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
# endif
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
	br = GetWindow_viewBgBrush(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2129
	if (! br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2130
	    bgClr = GetWindow_viewBgColor(hWnd);
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2131
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2132
# ifdef CACHE_LAST_WM_PAINT_BRUSH
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2133
	    if (last_wm_paint_brush
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2134
	     && (last_wm_paint_brush_clr == bgClr)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2135
		br = last_wm_paint_brush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2136
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2137
		if (bgClr == WhitePixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2138
		    br = __whiteBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2139
		} else if (bgClr == BlackPixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2140
		    br = __blackBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2141
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2142
		    if (last_wm_paint_brush) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2143
			_DeleteBrush(last_wm_paint_brush, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2144
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2145
		    last_wm_paint_brush = br = CreateSolidBrush(bgClr);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2146
		    last_wm_paint_brush_clr = bgClr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2147
		    isPrivateBrush = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2148
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2149
	    }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2150
# else
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2151
	    br = CreateSolidBrush(bgClr);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2152
	    isPrivateBrush = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2153
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2154
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2155
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2156
	if (! br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2157
	    console_fprintf(stderr, "WinWorkstation [info]: no brush\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2158
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2159
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2160
	if (br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2161
	    int i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2162
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2163
	    SelectClipRgn(dc, NULL);
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
	    for (i=0; i<numRects; i++) {
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
		 * always clear - even if not interested in exposes
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
		FillRect(dc, &(pRect[i]), br);
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
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2172
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2173
# ifndef CACHE_LAST_WM_PAINT_BRUSH
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2174
	if (isPrivateBrush) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2175
	    _DeleteBrush(br, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2176
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2177
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2178
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2179
# ifndef CACHE_LAST_WM_PAINT_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2180
	ReleaseDC(hWnd, dc);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2181
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2182
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  2183
# if defined(CACHE_LAST_WM_PAINT_DC)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2184
	RELEASE_PAINT_MUTEX
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2185
# endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2186
}
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2187
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2188
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2189
__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
  2190
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2191
	RECT rect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2192
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2193
	rect.left = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2194
	rect.top = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2195
	rect.right = x + w;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2196
	rect.bottom = y + h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2197
	__clearRectangles(hWnd, 1, &rect);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2198
}
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2199
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
 * 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
  2203
 * return the number of events (>0), if any was generated.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2204
 * 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
  2205
 * if a region is passed in, it is not destroyed.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2206
 */
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2207
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2208
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2209
__generateExposes(HWND hWnd, HRGN hRgnInOrNull, int msgType, int doClear)
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2210
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2211
	RECT updRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2212
	HRGN updRgn = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2213
	int numRects, ret, n, i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2214
	int wantExpose;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2215
	RECT *pRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2216
	union {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2217
	    RGNDATA rgnData;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2218
	    char    bytes[512];
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2219
	} data;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2220
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2221
	wantExpose = 0;
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
	if( msgType >= 0 )
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2224
	    wantExpose = (GetWindow_eventMask(hWnd) & ExposureMask);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2225
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2226
	if (hRgnInOrNull) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2227
	    updRgn = hRgnInOrNull;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2228
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2229
	    PAINTSTRUCT ps;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2230
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2231
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2232
	     * fetch the update region, even if ExposureMask is empty.
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
	    updRgn = CreateRectRgn(0, 0, 0, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2235
	    ret = GetUpdateRgn(hWnd, updRgn, FALSE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2236
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2237
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2238
	    BeginPaint(hWnd, &ps);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2239
	    /* store the rectangle required for image bit reversal */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2240
	    /* updateRect = ps.rcPaint;   */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2241
	    EndPaint(hWnd, &ps);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2242
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2243
	    switch (ret) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2244
		case ERROR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2245
		    console_fprintf(stderr, "WinWorkstation [info]: errregion\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2246
		    return -1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2247
		case NULLREGION:
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2248
		    DDDDPRINTF(("nullregion\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2249
		    _DeleteObject(updRgn, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2250
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2251
		case SIMPLEREGION:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2252
		case COMPLEXREGION:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2253
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2254
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2255
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2256
	n = GetRegionData(updRgn, sizeof(data), &(data.rgnData));
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
	/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2259
	 * the MS-doc states: n==1
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2260
	 * but this is not true
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2261
	 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2262
	if ((n >= sizeof(RGNDATA))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2263
	 && (n <= sizeof(data))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2264
	 && (data.rgnData.rdh.iType == RDH_RECTANGLES))  {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2265
	    /* ok, got the region */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2266
	    numRects = data.rgnData.rdh.nCount;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2267
	    pRect = (RECT *)(data.rgnData.Buffer);
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2268
	    DDDDPRINTF(("region numRects=%d\n", numRects));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2269
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2270
	    /* a big region ... */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2271
	    GetRgnBox(updRgn, &updRect);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2272
	    numRects = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2273
	    pRect = &updRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2274
	    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
  2275
		     n, sizeof(data),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2276
		     updRect.left, updRect.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2277
		     updRect.right, updRect.bottom));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2278
	    if (((updRect.right - updRect.left) <= 0)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2279
	     || ((updRect.bottom - updRect.top) <= 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2280
		numRects = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2281
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2282
	}
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
	if (numRects) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2285
	    if (doClear) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2286
		__clearRectangles(hWnd, numRects, pRect);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2287
	    }
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2288
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  2289
#ifndef PRE_21_NOV
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2290
	for (i=0; i < numRects; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2291
	    ValidateRect( hWnd, &pRect[i] );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2292
	}
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2293
#endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2294
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2295
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS1
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2296
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2297
		HDC hDC;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2298
		HBRUSH hBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2299
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2300
		hBrush = CreateSolidBrush(BlackPixel);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2301
		hDC = GetWindowDC(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2302
		SelectClipRgn(hDC, NULL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2303
		for (i=0; i<numRects; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2304
		    FillRect(hDC, &(pRect[i]), hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2305
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2306
		_DeleteBrush(hBrush, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2307
		ReleaseDC(hWnd, hDC);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2308
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2309
#endif
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
	    if (wantExpose) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2312
		for (i=0; i<numRects; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2313
		    int final = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2314
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2315
		    if ((msgType == __WM_GEXPOSE)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2316
		     && (i == (numRects - 1))) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2317
			final = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2318
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2319
		    enqEvent(ExposureMask, hWnd, msgType, final,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2320
			     (pRect[i].left), (pRect[i].top),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2321
			     (pRect[i].right - pRect[i].left),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2322
			     (pRect[i].bottom - pRect[i].top),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2323
			     EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2324
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2325
	    }
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
	if (updRgn && (updRgn != hRgnInOrNull)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2329
	    _DeleteObject(updRgn, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2330
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2331
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2332
	return numRects;
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2333
}
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2334
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2335
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2336
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2337
BOOL CALLBACK
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2338
recursiveExposeGenerator(HWND hChild, LPARAM param)
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2339
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2340
	__generateExposes(hChild, NULL, param, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2341
	return TRUE;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2342
}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2343
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2344
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2345
__generateRecursiveExposes(HWND hWnd, int msgType)
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2346
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2347
	EnumChildWindows(hWnd, recursiveExposeGenerator, msgType);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2348
}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2349
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2350
#endif /* sigh */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2351
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2352
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2353
static int
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  2354
getModifiers(void)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2355
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2356
    int modifiers = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2357
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2358
    if (GetKeyState(VK_SHIFT) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2359
	modifiers |= ShiftMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2360
    if (GetKeyState(VK_CONTROL) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2361
	modifiers |= ControlMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2362
#if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2363
    if (GetKeyState(VK_RMENU) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2364
	modifiers |= RightAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2365
    if (GetKeyState(VK_LMENU) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2366
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2367
#else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2368
    if (GetKeyState(VK_MENU) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2369
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2370
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2371
    if (GetKeyState(VK_LBUTTON) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2372
	modifiers |= Button1Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2373
    if (GetKeyState(VK_MBUTTON) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2374
	modifiers |= Button2Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2375
    if (GetKeyState(VK_RBUTTON) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2376
	modifiers |= Button3Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2377
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2378
    if ((modifiers & AnyButtonMask) == 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2379
	__eatingMouseEvents = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2380
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2381
    return modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2382
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2383
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2384
#ifndef PRE_01_APR_04
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2385
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2386
/* 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
  2387
   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
  2388
*/
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2389
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2390
# define MustHandleButtonEvent()\
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2391
    (((__currentCapture == CAPTURE_NONE)       \
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2392
     && (   (GetKeyState(VK_LBUTTON) & 0x8000) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2393
	 || (GetKeyState(VK_MBUTTON) & 0x8000) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2394
	 || (GetKeyState(VK_RBUTTON) & 0x8000) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2395
	)                                      \
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2396
    ) ? 0 : 1)
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2397
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2398
#else
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2399
# define MustHandleButtonEvent()   1
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2400
#endif
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2401
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2402
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2403
#ifdef HANDLE_VIEWGRAVITY
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2404
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2405
struct gravityCallBackInfo {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2406
    HWND parent;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2407
    int  currW, currH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2408
    int  newW, newH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2409
    int  parentWinX, parentWinY;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2410
};
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2411
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2412
static BOOL CALLBACK
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2413
gravityEnumeratorCallBack(HWND hChild, struct gravityCallBackInfo *iP)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2414
{
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2415
    localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2416
    int gravity;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2417
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2418
    if (lI = GETLOCALWINDOWINFOPTR(hChild)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2419
	if ((gravity = lI->viewGravity) != GRAVITY_NONE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2420
	    RECT oldChildRct, oldChildWinRct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2421
	    RECT newChildRct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2422
	    int deltaW, deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2423
	    int anyChange = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2424
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2425
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2426
	     * get its current bounds ...
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
	    GetClientRect(hChild, &oldChildRct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2429
	    deltaW = iP->newW - iP->currW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2430
	    deltaH = iP->newH - iP->currH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2431
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2432
	    GetWindowRect(hChild, &oldChildWinRct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2433
	    oldChildRct.left = oldChildWinRct.left - iP->parentWinX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2434
	    oldChildRct.top =  oldChildWinRct.top - iP->parentWinY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2435
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2436
	    newChildRct = oldChildRct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2437
	    switch (gravity) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2438
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2439
		case GRAVITY_N:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2440
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: North gravity\n", hChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2441
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2442
		     * shift to the bottom, for a constant
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2443
		     * distance from the bottom edge;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2444
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2445
		    newChildRct.bottom += deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2446
		    anyChange = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2447
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2448
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2449
		case GRAVITY_W:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2450
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: West gravity\n", hChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2451
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2452
		     * shift to the right, for a constant
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2453
		     * distance from the right edge;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2454
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2455
		    newChildRct.right += deltaW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2456
		    anyChange = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2457
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2458
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2459
		case GRAVITY_S:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2460
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: South gravity\n", hChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2461
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2462
		     * shift to the bottom, for a constant
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2463
		     * distance from the bottom edge;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2464
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2465
		    newChildRct.top += deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2466
		    newChildRct.bottom  += deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2467
		    anyChange = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2468
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2469
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2470
		case GRAVITY_E:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2471
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: East gravity\n", hChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2472
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2473
		     * shift to the right, for a constant
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2474
		     * distance from the right edge;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2475
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2476
		    newChildRct.right += deltaW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2477
		    newChildRct.left  += deltaW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2478
		    anyChange = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2479
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2480
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2481
		case GRAVITY_SE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2482
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: SouthEast gravity\n", hChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2483
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2484
		     * shift to the bottom-right, for a constant
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2485
		     * distance from the bottom-right edge;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2486
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2487
		    newChildRct.right += deltaW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2488
		    newChildRct.left  += deltaW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2489
		    newChildRct.top += deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2490
		    newChildRct.bottom  += deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2491
		    anyChange = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2492
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2493
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2494
		default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2495
		    DPRINTF(("Child %x: other gravity\n", hChild));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2496
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2497
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2498
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2499
	    if (anyChange) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2500
		if ((newChildRct.left < 0)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2501
		 || (newChildRct.top < 0)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2502
		 || (newChildRct.right >= iP->newW)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2503
		 || (newChildRct.bottom >= iP->newH)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2504
		    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
  2505
				    newChildRct.left, newChildRct.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2506
				    newChildRct.right, newChildRct.bottom);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2507
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2508
		    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
  2509
				    oldChildRct.left, oldChildRct.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2510
				    oldChildRct.right, oldChildRct.bottom,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2511
				    newChildRct.left, newChildRct.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2512
				    newChildRct.right, newChildRct.bottom);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2513
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2514
		    SetWindowPos(hChild, (HWND)0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2515
				 newChildRct.left, newChildRct.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2516
				 0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2517
				 /* SWP_NOSENDCHANGING | */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2518
				 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2519
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2520
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2521
	}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2522
    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2523
    return TRUE;
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
#endif /* HANDLE_VIEWGRAVITY */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2526
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2527
static void
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2528
ch2wch(char *in, wchar_t *out, int nMax)
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2529
{
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2530
    unsigned char *cp = (unsigned char *)in;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2531
    wchar_t *wcp = out;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2532
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2533
    while ((nMax > 1) && cp && *cp) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2534
	*wcp++ = *cp++;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2535
	nMax--;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2536
    }
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2537
    *wcp = 0;
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
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2540
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2541
winEventProcessing(
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2542
	HWND hWnd,         /* window handle                   */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2543
	UINT message,      /* type of message                 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2544
	UINT wParam,       /* additional information          */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2545
	INT lParam,        /* additional information          */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2546
	int *pDefault
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2547
    ) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2548
    int curButton;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2549
    int x, y, w, h;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2550
    int isNative = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2551
    UINT evTime;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2552
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2553
    /* kludge - info is in msg-struct,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2554
     * but lost here. (slightly inexact ... but who cares)
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2555
     */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2556
    evTime = lastMSGTime;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2557
    lastMSGTime = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2558
    if (evTime == 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2559
	lastMSGTime = GetTickCount();
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2560
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2561
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2562
/*
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2563
    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
  2564
			hWnd, message, wParam, lParam));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2565
*/
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2566
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2567
    if (hWnd) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2568
	if (message != WM_MOUSEMOVE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2569
	    lastMotionWnd = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2570
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2571
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2572
	isNative = (GetWindow_flag(hWnd) & LI_NATIVEWIN);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2573
	if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2574
	    NDPRINTF(("event %d (0x%x) for nativeWindow\n", message, message));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2575
	}
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2576
    }
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2577
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2578
    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2579
     * messages which are enqueued to be handled by the view thread
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
    switch (message) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2582
	case WM_THREAD_CREATEWINDOW:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2583
	    EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2584
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2585
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2586
		createWindowInfo *cwi = (createWindowInfo *)(lParam);
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
		if ((cwi->sequenceNr == wParam)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2589
		 && (cwi->sequenceNr != INVALIDATED_CWI)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2590
		    cwi->sequenceNr = INVALIDATED_CWI;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2591
		    cwi->infoWasRead = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2592
		    if (cwi->newWinHandle == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2593
			HANDLE ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2594
			HANDLE hwnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2595
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2596
			cwi->newWinHandle = hwnd = CreateWindowExW(
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2597
					    cwi->winStyleBitsEx,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2598
					    cwi->className,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2599
					    cwi->windowName,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2600
					    cwi->winStyleBits,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2601
					    cwi->x, cwi->y,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2602
					    cwi->dx, cwi->dy,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2603
					    cwi->parentHandle,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2604
					    NULL,           /* menu */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2605
					    (HANDLE) __getHInstance(),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2606
					    cwi->localWindowInfo
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2607
					   );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2608
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2609
			if (hwnd == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2610
			    cwi->errCode = GetLastError();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2611
			    console_fprintf(stderr, "WinWorkstation [info]: CreateWindow failed: %d (0x%x) [%d]\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2612
						cwi->errCode, cwi->errCode, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2613
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2614
			    SETLOCALWINDOWINFOPTR(hwnd, cwi->localWindowInfo);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2615
#ifdef DEBUG /* PARANOIA */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2616
			    if (GETLOCALWINDOWINFOPTR(hwnd) != cwi->localWindowInfo) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2617
			       console_fprintf(stderr, "lI-Error\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2618
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2619
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2620
			    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2621
					/* SWP_NOOWNERZORDER |*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2622
					SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2623
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2624
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2625
			ev = cwi->hCreateEvent;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2626
			if (ev) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2627
			    SetEvent(ev);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2628
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2629
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2630
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2631
		    DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2632
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2633
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2634
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2635
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2636
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2637
	case WM_THREAD_DESTROYWINDOW:
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
		HBRUSH br;
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
		br = GetWindow_viewBgBrush(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2642
		if (br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2643
		    SetWindow_viewBgBrush(hWnd, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2644
		    _DeleteBrushIfNotInCache(br, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2645
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2646
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2647
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2648
#ifdef CACHE_LAST_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2649
	    if (lastGcData && (lastGcHWIN == hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2650
		_releaseDC(lastGcData);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2651
	    }
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2652
#endif
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2653
#ifdef CACHE_LAST_WM_PAINT_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2654
	    if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2655
		ReleaseDC(hWnd, last_wm_paint_dc);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2656
		last_wm_paint_win = last_wm_paint_dc = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2657
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2658
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2659
	    if (! DestroyWindow(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2660
		DPRINTF(("DestroyWindow ERROR\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2661
	    } else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2662
#ifdef COUNT_RESOURCES
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2663
		__cnt_createWindows--;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2664
		RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2665
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2666
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2667
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2668
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2669
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2670
	case WM_CREATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2671
	    {
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2672
#ifdef SETLOCALINFO_IN_CREATE /* no longer */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2673
		localWindowInfo *lI;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2674
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2675
		CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
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
		lI = lpcs->lpCreateParams;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2678
		EVENT_PRINTF(("WM_CREATE lI=%x\n", lI));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2679
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2680
		SETLOCALWINDOWINFOPTR(hWnd, lI);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2681
# ifdef SUPERDEBUG
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2682
		if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2683
		    PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2684
		}
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2685
# endif /* SUPERDEBUG */
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2686
#endif
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2687
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2688
		*pDefault = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2689
#ifdef COUNT_RESOURCES
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2690
		__cnt_createWindows++;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2691
		RESPRINTF(("CreateWindows %d\n",__cnt_createWindows));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2692
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2693
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2694
	    break;
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
	case WM_CLOSE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2697
	    EVENT_PRINTF(("WM_CLOSE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2698
	    if (! destroyWin) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2699
		// (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2700
		enqEvent(0, hWnd, WM_CLOSE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2701
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2702
		destroyWin = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2703
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2704
		    HBRUSH br;
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
		    br = GetWindow_viewBgBrush(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2707
		    if (br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2708
			SetWindow_viewBgBrush(hWnd, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2709
			_DeleteBrushIfNotInCache(br, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2710
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2711
		}
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2712
#ifdef CACHE_LAST_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2713
		if (lastGcData && (lastGcHWIN == hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2714
		    _releaseDC(lastGcData);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2715
		}
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2716
#endif
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2717
#ifdef CACHE_LAST_WM_PAINT_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2718
		if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2719
		    ReleaseDC(hWnd, last_wm_paint_dc);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2720
		    last_wm_paint_win = last_wm_paint_dc = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2721
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2722
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2723
		if (! DestroyWindow(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2724
		    DPRINTF(("DestroyWindow ERROR\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2725
		} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2726
#ifdef COUNT_RESOURCES
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2727
		    __cnt_createWindows--;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2728
		    RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2729
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2730
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2731
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2732
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2733
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2734
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2735
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2736
	case WM_DESTROY:
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
		char *nm = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2739
		localWindowInfo *lI;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2740
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2741
		lI = GETLOCALWINDOWINFOPTR(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2742
		EVENT_PRINTF(("WM_DESTROY %x li=%x\n", hWnd, lI));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2743
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2744
#ifdef TOPWINDOWCLASS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2745
		if (lI) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2746
		    if (lI->flag & LI_TOPWIN) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2747
			nm = (char*) malloc(300);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2748
			GetClassName(hWnd, nm, 300);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2749
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2750
		    /* freeing now done in other thread */
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
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2753
		SETLOCALWINDOWINFOPTR(hWnd, 0);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2754
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2755
#ifdef FREE_LI_IN_STX_PROCESS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2756
		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
  2757
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2758
		if (lI) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2759
		    free(lI);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2760
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2761
		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
  2762
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2763
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2764
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2765
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2766
	    break;
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
	case WM_GETMINMAXINFO:
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2769
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2770
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2771
	    if (inMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2772
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2773
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2774
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2775
#endif
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
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2778
		int minW, maxW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2779
		localWindowInfo *lI;
6494
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2780
		LPMINMAXINFO lpmmi = (LPMINMAXINFO) lParam;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2781
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2782
		EVENT_PRINTF2(("WM_GETMINMAXINFO handle=%x got min: %d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2783
			    hWnd,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2784
			    lpmmi->ptMinTrackSize.x,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2785
			    lpmmi->ptMinTrackSize.y));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2786
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2787
		lI = GETLOCALWINDOWINFOPTR(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2788
		if (lI && (lI->minWidth) && (lI->maxWidth)) {
6494
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2789
		  lpmmi->ptMaxPosition.x = 0;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2790
		  lpmmi->ptMaxPosition.y = 0;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2791
		  lpmmi->ptMaxSize.x = lI->currentMonitorWidth;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2792
		  lpmmi->ptMaxSize.y = lI->currentMonitorHeight;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2793
#define MIN(a, b) (a < b ? a : b)
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2794
		  lpmmi->ptMaxSize.x = MIN(GetSystemMetrics(SM_CXMAXIMIZED), lI->maxWidth);
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2795
		  lpmmi->ptMaxSize.y = MIN(GetSystemMetrics(SM_CYMAXIMIZED), lI->maxHeight);
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2796
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2797
		  lpmmi->ptMaxTrackSize.x = lI->maxWidth == 0 ? GetSystemMetrics(SM_CXMAXTRACK) : lI->maxWidth;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2798
		  lpmmi->ptMaxTrackSize.y = lI->maxHeight == 0 ? GetSystemMetrics(SM_CYMAXTRACK) : lI->maxHeight;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2799
		  lpmmi->ptMinTrackSize.x = lI->minWidth;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2800
		  lpmmi->ptMinTrackSize.y = lI->minHeight;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2801
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2802
		  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
  2803
				  hWnd,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2804
				  lI->minWidth, lI->minHeight,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2805
				  lI->maxWidth, lI->maxHeight));
6494
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2806
		  *pDefault = 0;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2807
		}
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2808
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2809
	    break;
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
	case WM_SETCURSOR:
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
		HCURSOR curs;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2814
		int hitCode;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2815
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2816
		hitCode = LOWORD(lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2817
		if (hitCode != HTCLIENT) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2818
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2819
		     * not in client area ...
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
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2822
		}
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  2823
		DPRINTFIF(__debug_WM_SETCURSOR__ , ("WM_SETCURSOR\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2824
		curs = GetWindow_Cursor(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2825
		if (curs) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2826
		    SetCursor(curs);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2827
		    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2828
		    return 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2829
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2830
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2831
	    return 0;
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
	case WM_WINDOWPOSCHANGED:
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2834
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2835
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2836
	    if (inMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2837
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2838
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2839
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2840
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2841
	    if (hWnd == __rootWinSpezial) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2842
		/* can this happen ? */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2843
		*pDefault = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2844
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2845
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2846
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2847
	    if (! inMove && (__currentCapture == CAPTURE_NONE)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2848
		POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2849
		HWND hWndChild,hWndTemp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2850
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2851
		p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2852
		p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2853
		ScreenToClient(hWnd, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2854
		hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2855
		do {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2856
		    hWndTemp = hWndChild;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2857
		    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2858
		} while ((hWndChild) && (hWndChild != hWndTemp));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2859
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2860
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2861
		    if (hWndChild != __currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2862
			int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2863
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2864
			if (__currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2865
			    if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2866
				if (needDelayedMouseLeaveWindow == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2867
				    needDelayedMouseLeaveWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2868
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2869
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2870
				if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2871
				    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2872
				    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2873
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2874
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2875
			    __currentPointerView = 0;
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
			if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2878
			    needDelayedMouseEnterWindow = hWndChild;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2879
			    delayedMouseEnterX = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2880
			    delayedMouseEnterY = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2881
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2882
			    if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2883
				enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2884
				SetWindow_mouseXY(hWndChild, evRootX, evRootY);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2885
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2886
			    // SetFocus(hWndChild);
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
			__currentPointerView = 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
		}
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
	     * ignore child window messages ...
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
	    if (GetParent(hWnd) != NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2897
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2898
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2899
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
		WINDOWPOS *wp = (WINDOWPOS *)lParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2902
		RECT rct, dRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2903
		int x, y, w, h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2904
		int dW, dH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2905
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2906
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2907
		dRect.left = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2908
		dRect.top = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2909
		dRect.right = 100;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2910
		dRect.bottom = 100;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2911
		winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2912
		winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2913
		AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2914
		dW = dRect.right - dRect.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2915
		dH = dRect.bottom - dRect.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2916
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2917
		GetClientRect(hWnd, &rct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2918
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2919
		x = rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2920
		y = rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2921
		w = rct.right - rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2922
		h = rct.bottom - rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2923
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2924
		if (__debug__) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2925
		    EVENT_PRINTF(("WM_WINDOWPOSCHANGED ["));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2926
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2927
		    if (wp->flags & SWP_NOSIZE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2928
			EVENT_PRINTF(("NOSIZE "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2929
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2930
		    if (wp->flags & SWP_NOMOVE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2931
			EVENT_PRINTF(("NOMOVE "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2932
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2933
		    if (wp->flags & SWP_NOZORDER) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2934
			EVENT_PRINTF(("NOZORDER "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2935
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2936
		    if (wp->flags & SWP_NOREDRAW) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2937
			EVENT_PRINTF(("NOREDRAW "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2938
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2939
		    if (wp->flags & SWP_NOACTIVATE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2940
			EVENT_PRINTF(("NOACTIVATE "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2941
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2942
		    if (wp->flags & SWP_FRAMECHANGED) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2943
			EVENT_PRINTF(("FRAMECHANGED "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2944
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2945
		    if (wp->flags & SWP_NOCOPYBITS) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2946
			EVENT_PRINTF(("NOCOPYBITS "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2947
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2948
		    if (wp->flags & SWP_NOOWNERZORDER) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2949
			EVENT_PRINTF(("NOOWNERZORDER "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2950
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2951
		    if (wp->flags & SWP_NOSENDCHANGING) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2952
			EVENT_PRINTF(("NOSENDCHANGING "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2953
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2954
		    if (wp->flags & SWP_DEFERERASE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2955
			EVENT_PRINTF(("DEFERERASE "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2956
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2957
		    if (wp->flags & SWP_ASYNCWINDOWPOS) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2958
			EVENT_PRINTF(("ASYNCWINDOWPOS "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2959
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2960
		    if (wp->flags & SWP_HIDEWINDOW) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2961
			EVENT_PRINTF(("HIDEWINDOW "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2962
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2963
		    if (wp->flags & SWP_SHOWWINDOW) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2964
			EVENT_PRINTF(("SHOWWINDOW "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2965
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2966
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2967
		    EVENT_PRINTF(("] %d/%d %d/%d flags:%d (0x%x) ->",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2968
				wp->x, wp->y, wp->cx, wp->cy, wp->flags, wp->flags));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2969
		    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
  2970
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2971
		} /* __debug__ */
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2972
#ifdef THIS_IS_WRONG
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2973
		if (!(wp->flags & SWP_NOSIZE)) {
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2974
		    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
  2975
		    w = wp->cx;
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2976
		    h = wp->cy;
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2977
		}
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2978
		if (!(wp->flags & SWP_NOMOVE)) {
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2979
		    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
  2980
		    x = wp->x;
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2981
		    y = wp->y;
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2982
		}
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2983
#endif
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2984
		lastPos_win = 0;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2985
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2986
		if ((w == 0) && (h == 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2987
		    EVENT_PRINTF(("w,h = 0.\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2988
		    if (! GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2989
			EVENT_PRINTF(("iconified.\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2990
			SetWindow_iconified(hWnd, 1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2991
			DPRINTF(("WM_WINDOWPOSCHANGED to iconified (flags:0x%x)\n", wp->flags));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2992
			enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2993
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2994
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2995
		    if (GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2996
			EVENT_PRINTF(("deiconified.\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2997
			SetWindow_iconified(hWnd, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2998
			DPRINTF(("WM_WINDOWPOSCHANGED to deiconified (flags:0x%x)\n", wp->flags));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2999
			enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3000
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3001
		    if (!(wp->flags & SWP_NOSIZE)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3002
		     || !(wp->flags & SWP_NOMOVE)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3003
			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
  3004
#ifdef COMPRESS_WINDOWPOSCHANGED
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3005
			/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3006
			 * remember the current
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3007
			 * window and size;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3008
			 * This allows the backend to ignore
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3009
			 * intermediate events.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3010
			 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3011
			lastPos_w = w;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3012
			lastPos_h = h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3013
			lastPos_x = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3014
			lastPos_y = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3015
			lastPos_win = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3016
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3017
			enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3018
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3019
			EVENT_PRINTF(("no event due to SWP_NOSIZE/SWP_NOMOVE.\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3020
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3021
		}
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
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3024
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3025
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3026
	case WM_ERASEBKGND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3027
	    DPRINTFIF(__debug_WM_ERASEBKGND__ , ("WM_ERASEBKGND\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3028
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3029
		NDPRINTF(("WM_ERASEBKGND for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3030
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3031
	    }
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3032
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3033
#ifndef PRE_21_NOV
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3034
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3035
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3036
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3037
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3038
	    if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3039
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3040
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3041
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3042
	    if (hWnd == __rootWinSpezial) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3043
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3044
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3045
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3046
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3047
	    /* THIS_WORKS */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3048
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3049
	    return 0;
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3050
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  3051
#endif  /* ! PRE_21_NOV */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3052
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3053
	case WM_PAINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3054
	    DPRINTFIF(__debug_WM_PAINT__ , ("WM_PAINT ********************* "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3055
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3056
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3057
		NDPRINTF(("WM_PAINT for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3058
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3059
	    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  3060
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3061
#ifndef PRE_21_NOV
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3062
	    {   int n;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3063
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3064
		n = __generateExposes( hWnd, NULL, WM_PAINT, 0 );
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
		if( n <= 0 ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3067
		    * pDefault = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3068
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3069
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3070
		* pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3071
		return n;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3072
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3073
#else
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
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
	    if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3078
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3079
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3080
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3081
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3082
	    if (hWnd == __rootWinSpezial) {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3083
# ifdef THIS_MAKES_GUI_PAINTER_START_SLOW
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3084
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3085
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3086
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3087
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3088
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
		int retVal;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3091
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  3092
# ifdef LATE_GENERATE_EXPOSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3093
		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
  3094
# else
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3095
		AQUIRE_DRAW_MUTEX
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3096
		retVal = __generateExposes(hWnd, NULL, WM_PAINT, WM_PAINT_CLEAR_EARLY);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3097
		RELEASE_DRAW_MUTEX
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3098
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3099
		switch (retVal) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3100
		    case -1:  /* error */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3101
			*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3102
			break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3103
		    case 0:   /* nothing generated */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3104
		    default:  /* generated events */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3105
			break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3106
		}
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3107
# ifdef THIS_IS_BAD
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3108
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3109
		return 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3110
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3111
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3112
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3113
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  3114
#endif  /* ! PRE_21_NOV */
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3115
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3116
	case WM_SIZE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3117
	    DPRINTFIF(__debug_WM_SIZE__ , ("WM_SIZE\n"));
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  3118
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  3119
	    lastPos_win = 0;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3120
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3121
	     * ignore child window messages ...
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
	    if (GetParent(hWnd) != NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3124
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3125
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3126
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3127
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3128
	    switch (wParam) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3129
		case SIZE_MAXIMIZED:     /* default handling */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3130
		case SIZE_MINIMIZED:     /* default handling */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3131
		case SIZE_RESTORED:      /* default handling */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3132
		    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3133
			RECT rct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3134
			int x, y, w, h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3135
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3136
			GetClientRect(hWnd, &rct);
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
			x = rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3139
			y = rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3140
			w = rct.right - rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3141
			h = rct.bottom - rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3142
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3143
			EVENT_PRINTF(("WM_MIN/MAX/RESTORED\n"));
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
			if ((w == 0) && (h == 0)) {
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
			     * iconified ...
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
			    if (! GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3150
				SetWindow_iconified(hWnd, 1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3151
				enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3152
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3153
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3154
			    if (GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3155
				SetWindow_iconified(hWnd, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3156
				enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3157
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3158
			    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
  3159
#ifdef COMPRESS_WINDOWPOSCHANGED
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3160
			    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3161
			     * remember the current
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3162
			     * window and size;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3163
			     * This allows the backend to ignore
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3164
			     * intermediate events.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3165
			     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3166
			    lastPos_w = w;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3167
			    lastPos_h = h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3168
			    lastPos_x = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3169
			    lastPos_y = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3170
			    lastPos_win = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3171
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3172
			    enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3173
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3174
		   }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3175
		   break;
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
		default:                 /* ignore */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3178
		    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3179
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3180
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3181
	    break;
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
	case WM_DROPFILES:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3184
	    DPRINTFIF(__debug_WM_DROPFILES__ , ("WM_DROPFILES\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3185
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3186
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3187
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3188
	case WM_SHOWWINDOW:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3189
	    DPRINTFIF(__debug_WM_SHOWWINDOW__ , ("WM_SHOWWINDOW h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3190
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3191
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3192
		NDPRINTF(("WM_SHOWWINDOW for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3193
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3194
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3195
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3196
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3197
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3198
	case WM_MOUSEACTIVATE :
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3199
	    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
  3200
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3201
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3202
	     * ignore child window messages ...
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
	    if (GetParent(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3205
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3206
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3207
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3208
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3209
	    if ((hWnd == __rootWinSpezial) || (hWnd == GetActiveWindow())) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3210
		DDPRINTF(("NOACTIVATE (root or already)\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3211
		return MA_NOACTIVATE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3212
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3213
	    if (LOWORD(lParam) != HTCLIENT) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3214
		DDPRINTF(("ACTIVATE (not client)\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3215
		return MA_ACTIVATE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3216
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3217
	    if (__activateOnClick) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3218
		if (__ignoreButtonPressOnActivate) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3219
		    DDPRINTF(("ACTIVATE_EAT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3220
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3221
		     * windows is sooo stupid:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3222
		     * it will send me a MOTION soon after, with the
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3223
		     * to the click location, with the buttonState down.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3224
		     * The app will interpret that as a pressed motion and
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3225
		     * do a selection (if in a textview).
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3226
		     * To prevent this, we set a flag here, that the following
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3227
		     * motion is to be suppressed.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3228
		     * Until the mouse is released.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3229
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3230
		    __eatingMouseEvents = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3231
		    return MA_ACTIVATEANDEAT;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3232
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3233
		DDPRINTF(("ACTIVATE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3234
		return MA_ACTIVATE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3235
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3236
	    DDPRINTF(("NO_ACTIVATE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3237
	    return MA_NOACTIVATE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3238
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3239
	case WM_NCHITTEST:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3240
	    EVENT_PRINTF2(("WM_NCHITTEST\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3241
	    if (hWnd == __rootWinSpezial) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3242
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3243
		return HTCLIENT;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3244
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3245
	    break;
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
	case WM_NCACTIVATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3248
	    EVENT_PRINTF(("WM_NCACTIVATE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3249
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3250
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3251
	case WM_ACTIVATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3252
	    CPRINTF(("WM_ACTIVATE %s h=%x\n", LOWORD(wParam) ? "active" : "inactive", hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3253
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3254
	    switch (LOWORD(wParam)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3255
		case WA_INACTIVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3256
		    EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3257
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3258
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3259
		case WA_ACTIVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3260
		    EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3261
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3262
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3263
		    __generateRecursiveExposes(hWnd, WM_PAINT);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3264
#endif /* sigh */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3265
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3266
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3267
		case WA_CLICKACTIVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3268
		    EVENT_PRINTF2(("++ WM_ACTIVATE clkactive h=%x\n", hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3269
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3270
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3271
		default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3272
		    EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3273
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3274
	    }
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3275
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3276
#ifndef PRE_25_NOV_03
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3277
	    if (__currentCapture == CAPTURE_NONE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3278
		HWND  newHWnd = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3279
		POINT newPoint;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3280
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3281
		if (LOWORD(wParam) != WA_INACTIVE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3282
		    if (MustHandleButtonEvent()) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3283
			newPoint.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3284
			newPoint.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3285
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3286
			newHWnd = WindowFromPoint (newPoint);
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
			if (newHWnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3289
			    if ( (newHWnd == hWnd) || IsChild(hWnd, newHWnd) ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3290
				ScreenToClient (newHWnd, & newPoint);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3291
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3292
				if ((newPoint.x < 0) || (newPoint.y < 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3293
				    newHWnd = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3294
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3295
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3296
				newHWnd = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3297
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3298
			}
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
		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
  3302
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3303
		if (newHWnd != __currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3304
		    int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3305
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3306
		    if (__currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3307
			if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3308
			    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3309
			    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3310
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3311
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3312
		    __currentPointerView = newHWnd;
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
		    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3315
			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
  3316
			SetWindow_mouseXY(__currentPointerView, newPoint.x, newPoint.y);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3317
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3318
		}
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
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3321
	    enqEvent(0, hWnd, WM_ACTIVATE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3322
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3323
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3324
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3325
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3326
	    break;
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
	case WM_HOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3329
	    // console_fprintf(stderr, "winEventProcessing [info]: receive hotkey %x\n",wParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3330
	    DPRINTFIF(__debug_WM_KEYUP__ , ("WM_HOTKEY %x\n", wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3331
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3332
		enqEvent(0, hWnd, WM_HOTKEY, wParam, lParam, 0, 0, 0, evTime);
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
	    break;
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
	case WM_SYSCHAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3337
	    EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3338
	    goto commonChar;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3339
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  3340
#ifdef WM_UNICHAR
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3341
	/* does not work, anyway */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3342
	case WM_UNICHAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3343
	    DPRINTFIF(__debug_WM_CHAR__ , ("WM_UNICHAR h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3344
	    if (wParam == UNICODE_NOCHAR) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3345
		/* 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
  3346
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3347
		return 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3348
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3349
	    goto commonChar;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3350
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3351
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3352
	case WM_CHAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3353
	    DPRINTFIF(__debug_WM_CHAR__ , ("WM_CHAR h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3354
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3355
	    EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3356
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3357
	commonChar:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3358
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3359
		NDPRINTF(("WM_CHAR for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3360
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3361
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3362
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
		HWND destWindow;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3365
		int evMask;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3366
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3367
		if (__focusFollowsMouse) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3368
		    destWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3369
		    if (destWindow == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3370
			destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3371
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3372
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3373
		    destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3374
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3375
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3376
		evMask = GetWindow_eventMask(destWindow);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3377
		if (evMask & (KeyPressMask | KeyReleaseMask)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3378
		    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3379
		    int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3380
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3381
		    p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3382
		    p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3383
		    ScreenToClient(destWindow, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3384
		    x = p.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3385
		    y = p.y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3386
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3387
		    DPRINTFIF(__debug_WM_CHAR__ , ("key:%x modifiers: %x\n", wParam, modifiers));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3388
		    if (evMask & KeyPressMask)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3389
			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
  3390
		    if (evMask & KeyReleaseMask)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3391
			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
  3392
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3393
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3394
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3395
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3396
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3397
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3398
	case WM_KEYUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3399
	    DPRINTFIF(__debug_WM_KEYUP__ , ("WM_KEYUP h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3400
	    goto commonKeyUp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3401
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3402
	case WM_SYSKEYUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3403
	    DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n, wParam"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3404
	commonKeyUp:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3405
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3406
		NDPRINTF(("WM_KEYUP/WM_SYSKEYUP for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3407
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3408
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3409
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3410
		HWND destWindow;
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
		if (__focusFollowsMouse) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3413
		    destWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3414
		    if (destWindow == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3415
			destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3416
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3417
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3418
		    destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3419
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3420
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3421
		if (GetWindow_eventMask(destWindow) & KeyReleaseMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3422
		    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3423
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3424
		    p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3425
		    p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3426
		    ScreenToClient(destWindow, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3427
		    x = p.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3428
		    y = p.y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3429
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3430
		    enqEvent(KeyReleaseMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
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
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3433
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3434
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3435
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3436
	case WM_SYSKEYDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3437
	    DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n, wParam"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3438
	    goto commonKey;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3439
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3440
	case WM_KEYDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3441
	    DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3442
	commonKey:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3443
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3444
		NDPRINTF(("WM_KEYDOWN/WM_SYSKEYDOWN for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3445
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3446
	    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3447
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3448
#ifdef EXIT_WITH_3_CTRL_Cs
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3449
	    if ((msg.wParam == 'c')
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3450
	     && (GetKeyState(VK_CONTROL) & 0x8000)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3451
		/* CTRL-C */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3452
		if (ctrl_c_count++ > 3)  /* for debugging */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3453
		    exit(1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3454
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3455
		if (msg.wParam != VK_CONTROL)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3456
		    ctrl_c_count = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3457
	    }
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3458
#endif
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  3459
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3460
	    if (msg.wParam == VK_ESCAPE)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3461
		/* ESCAPE */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3462
		if (escape_count++ > 3) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3463
		    __currentCapture = CAPTURE_NONE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3464
		    ReleaseCapture();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3465
		    CPRINTF(("ReleaseCapture <ESC>\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3466
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3467
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3468
		escape_count = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3469
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3470
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3471
	    /* FALL INTO */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3472
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3473
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3474
		HWND destWindow;
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
		if (__focusFollowsMouse) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3477
		    destWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3478
		    if (destWindow == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3479
			destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3480
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3481
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3482
		    destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3483
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3484
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3485
		if (GetWindow_eventMask(destWindow) & KeyPressMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3486
		    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3487
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3488
		    p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3489
		    p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3490
		    ScreenToClient(destWindow, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3491
		    x = p.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3492
		    y = p.y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3493
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3494
		    enqEvent(KeyPressMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
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
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3497
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3498
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3499
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3500
#ifdef WM_MOUSEWHEEL
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3501
	case WM_MOUSEWHEEL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3502
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3503
		HWND destWindow;
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
		if (__focusFollowsMouse) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3506
		    destWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3507
		    if (destWindow == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3508
			destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3509
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3510
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3511
		    destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3512
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3513
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
		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
  3516
		if (GetWindow_eventMask(destWindow) & KeyPressMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3517
		    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3518
		    int delta;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3519
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3520
		    p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3521
		    p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3522
		    ScreenToClient(destWindow, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3523
		    x = p.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3524
		    y = p.y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3525
		    delta = evTime - lastMouseWheelTime;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3526
		    if (evTime < lastMouseWheelTime) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3527
			delta = (0xFFFFFFFF - lastMouseWheelTime) + evTime;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3528
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3529
		    enqEvent(0, destWindow, message, wParam, x, y, lParam, getModifiers(), delta);
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
		lastMouseWheelTime = evTime;
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
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3534
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3535
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3536
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3537
	case WM_MOUSEMOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3538
	    DPRINTFIF(__debug_WM_MOUSEMOVE__ , ("WM_MOUSEMOVE h=%x\n", hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3539
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3540
		NDPRINTF(("WM_MOUSEMOVE for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3541
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3542
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3543
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3544
	    if (hWnd != __currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3545
		if (! MustHandleButtonEvent()) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3546
		    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3547
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3548
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3549
	    }
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
		short x, y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3553
		int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3554
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3555
		x = (int)(short)LOWORD(lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3556
		y = (int)(short)HIWORD(lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3557
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3558
		if (__currentCapture == CAPTURE_NONE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3559
		    if (hWnd != __currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3560
			HWND prevPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3561
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3562
			prevPointerView = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3563
			if (prevPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3564
			    if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3565
				if (needDelayedMouseLeaveWindow == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3566
				    needDelayedMouseLeaveWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3567
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3568
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3569
				if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3570
				    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3571
				    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3572
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3573
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3574
			    __currentPointerView = 0;
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
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3577
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3578
			if (__activateOnClick) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3579
			    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3580
			     * only send mouseEnter if the window belongs to the current
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3581
			     * active window
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3582
			     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3583
			    if (GetTopParent(prevPointerView) == GetTopParent(hWnd)) {
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
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3586
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3587
			if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3588
			    needDelayedMouseEnterWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3589
			    delayedMouseEnterX = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3590
			    delayedMouseEnterY = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3591
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3592
			    if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3593
				enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers, evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3594
				SetWindow_mouseXY(hWnd, x, y);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3595
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3596
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3597
			__currentPointerView = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3598
		    }
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3599
		    DPRINTFIF(__debug_WM_MOUSEMOVE__ , ("MouseMove %x\n", __currentPointerView));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3600
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3601
		    CPRINTF(("MouseMove Capture %x\n", __currentPointerView));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3602
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3603
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3604
		if ((GetWindow_eventMask(__currentPointerView) & PointerMotionMask)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3605
		 || (modifiers & AnyButtonMask)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3606
		    if (! __eatingMouseEvents) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3607
			if ((x == lastMotionX)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3608
			 && (y == lastMotionY)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3609
			 && (__currentPointerView == lastMotionWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3610
			    /* ignore */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3611
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3612
			    lastMotionX = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3613
			    lastMotionY = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3614
			    lastMotionWnd = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3615
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3616
			    if ((GetWindow_mouseX(__currentPointerView) == x)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3617
			     && (GetWindow_mouseY(__currentPointerView) == y)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3618
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3619
				enqEvent(PointerMotionMask, __currentPointerView, WM_MOUSEMOVE, wParam, x, y, 0, modifiers, evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3620
				SetWindow_mouseXY(__currentPointerView, x, y);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3621
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3622
			}
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
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3627
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3628
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3629
	case WM_LBUTTONUP:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3630
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_LBUTTONUP h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3631
	    curButton = Button1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3632
	    goto commonButtonUp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3633
	case WM_MBUTTONUP:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3634
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_MBUTTONUP h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3635
	    curButton = Button2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3636
	    goto commonButtonUp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3637
	case WM_RBUTTONUP:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3638
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_RBUTTONUP h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3639
	    curButton = Button3;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3640
commonButtonUp:
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3641
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3642
		NDPRINTF(("WM_*BUTTONUP for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3643
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3644
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3645
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  3646
#ifndef PRE_01_APR_04
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3647
	    if ((__currentPointerView != hWnd) && (__currentPointerView == (HANDLE)0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3648
		__currentPointerView = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3649
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3650
		if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3651
		    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3652
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3653
		    p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3654
		    p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3655
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3656
		    ScreenToClient (hWnd, & p);
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
		    if ((p.x >= 0) && (p.y >= 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3659
			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
  3660
			SetWindow_mouseXY(hWnd, p.x, p.y);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3661
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3662
			__currentPointerView = (HANDLE) 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3663
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3664
		}
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
#endif
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
	    if (__currentCapture == curButton /* CAPTURE_IMPLICIT*/) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3669
		__currentCapture = CAPTURE_NONE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3670
		ReleaseCapture();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3671
		CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3672
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3673
	    EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3674
			   hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3675
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3676
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3677
	    if (GetWindow_eventMask(hWnd) & ButtonReleaseMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3678
		if (__eatingMouseEvents) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3679
		    __eatingMouseEvents = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3680
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3681
		    enqEvent(ButtonReleaseMask, hWnd,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3682
			     message, wParam, (UINT)(short)LOWORD(lParam), (INT)(short)HIWORD(lParam),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3683
			     wParam, getModifiers(), evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3684
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3685
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3686
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3687
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3688
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3689
	case WM_LBUTTONDBLCLK:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3690
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_LBUTTONDBLCLK h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3691
	    curButton = Button1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3692
	    goto commonButtonDown;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3693
	case WM_MBUTTONDBLCLK:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3694
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_MBUTTONDBLCLK h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3695
	    curButton = Button2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3696
	    goto commonButtonDown;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3697
	case WM_RBUTTONDBLCLK:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3698
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_RBUTTONDBLCLK h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3699
	    curButton = Button3;
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
  3700
#ifdef PRE_25_AUG_2010
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3701
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3702
		 NDPRINTF(("WM_*BUTTONDBLCLK for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3703
		 return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3704
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3705
	    goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3706
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3707
	    goto commonButtonDown;
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
  3708
#endif /* PRE_25_AUG_2010 */
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
  3709
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3710
	case WM_LBUTTONDOWN:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3711
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_LBUTTONDOWN h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3712
	    curButton = Button1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3713
	    goto commonButtonDown;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3714
	case WM_MBUTTONDOWN:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3715
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_MBUTTONDOWN h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3716
	    curButton = Button2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3717
	    goto commonButtonDown;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3718
	case WM_RBUTTONDOWN:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3719
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_RBUTTONDOWN h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3720
	    curButton = Button3;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3721
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3722
	commonButtonDown:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3723
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3724
		NDPRINTF(("WM_*BUTTONDOWN for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3725
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3726
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3727
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3728
	commonButtonWithCapture:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3729
	    if (__currentCapture == CAPTURE_NONE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3730
		__currentCapture = curButton /*CAPTURE_IMPLICIT*/;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3731
		//SetFocus(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3732
		SetCapture(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3733
		CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3734
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3735
	    goto commonButton;
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
	commonButton:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3738
	    EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3739
			   hWnd, LOWORD(lParam), HIWORD(lParam)));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3740
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3741
	    if (GetWindow_eventMask(hWnd) & ButtonPressMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3742
		if (__eatingMouseEvents) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3743
		    __eatingMouseEvents = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3744
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3745
		    enqEvent(ButtonPressMask, hWnd,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3746
			     message, wParam, (UINT)(short)LOWORD(lParam), (INT)(short)HIWORD(lParam),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3747
			     wParam, getModifiers(), evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3748
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3749
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3750
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3751
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3752
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3753
	case WM_CAPTURECHANGED:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3754
	    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
  3755
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3756
	    if ((__currentCapture != CAPTURE_NONE) && (__currentCapture != CAPTURE_EXPLICIT))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3757
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3758
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3759
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3760
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3761
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3762
	case WM_KILLFOCUS:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3763
	    DPRINTFIF(__debug_WM_FOCUS__ , ("WM_KILLFOCUS h=%x\n", hWnd));
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3764
	    // 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
  3765
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3766
		NDPRINTF(("WM_KILLFOCUS for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3767
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3768
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3769
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3770
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3771
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3772
	case WM_SETFOCUS:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3773
	    DPRINTFIF(__debug_WM_FOCUS__ , ("WM_SETFOCUS h=%x\n", hWnd));
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3774
#if 0
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3775
	    // 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
  3776
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3777
		POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3778
		HWND hWndChild,hWndTemp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3779
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3780
		p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3781
		p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3782
		ScreenToClient(hWnd, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3783
		hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3784
		do {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3785
		    hWndTemp = hWndChild;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3786
		    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3787
		} while ((hWndChild) && (hWndChild != hWndTemp));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3788
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3789
		/*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
  3790
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3791
		    if (hWndChild != __currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3792
			int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3793
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3794
			if (__currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3795
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3796
				enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3797
				SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3798
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3799
			    __currentPointerView = 0;
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
			if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3802
			    enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3803
			    SetWindow_mouseXY(hWndChild, evRootX, evRootY);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3804
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3805
			//SetFocus(hWndChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3806
			__currentPointerView = hWndChild;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3807
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3808
		}
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
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3812
		NDPRINTF(("WM_SETFOCUS for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3813
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3814
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3815
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3816
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3817
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3818
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3819
	case WM_GETTEXT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3820
	    /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3821
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3822
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3823
	case WM_GETTEXTLENGTH:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3824
	    EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3825
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3826
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3827
	case WM_NCCREATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3828
	    EVENT_PRINTF(("WM_NCCREATE %x\n", message));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3829
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3830
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3831
	case WM_NCMOUSEMOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3832
	    if (__currentCapture == CAPTURE_NONE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3833
		if (__currentPointerView && (hWnd != __currentPointerView)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3834
		    if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3835
			if (needDelayedMouseLeaveWindow == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3836
			    needDelayedMouseLeaveWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3837
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3838
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3839
			if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3840
			    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3841
			    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3842
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3843
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3844
		    __currentPointerView = 0;
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
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3847
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3848
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3849
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3850
	case WM_PARENTNOTIFY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3851
	    EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3852
				hWnd, lParam, LOWORD(wParam)));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3853
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3854
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3855
	case WM_NCLBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3856
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCLBUTTONDOWN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3857
	    if (__shiftedLeftButtonIsLowerWindow) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3858
		/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3859
		 * with shift, this is a lower-operation
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
		if (GetKeyState(VK_SHIFT) & 0x8000) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3862
		    SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3863
				 SWP_NOSENDCHANGING |
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3864
				 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3865
		    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3866
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3867
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3868
	    break;
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
	case WM_NCLBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3871
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCLBUTTONUP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3872
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3873
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3874
	case WM_NCRBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3875
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCRBUTTONDOWN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3876
	    if (__rightButtonIsLowerWindow) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3877
		/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3878
		 * this is a lower-operation
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
		SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3881
			     SWP_NOSENDCHANGING |
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3882
			     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3883
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3884
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3885
	    break;
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
	case WM_NCRBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3888
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCRBUTTONUP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3889
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3890
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3891
	case WM_NCMBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3892
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCMBUTTONDOWN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3893
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3894
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3895
	case WM_NCMBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3896
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCMBUTTONUP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3897
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3898
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3899
	case WM_NCLBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3900
	    EVENT_PRINTF(("WM_NCLBUTTONDBLCLK\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3901
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3902
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3903
	case WM_NCRBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3904
	    EVENT_PRINTF(("WM_NCRBUTTONDBLCLK\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3905
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3906
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3907
	case WM_NCMBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3908
	    EVENT_PRINTF(("WM_NCMBUTTONDBLCLK\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3909
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3910
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3911
	case WM_SETTEXT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3912
	    DPRINTFIF(__debug_WM_SETTEXT__ , ("WM_SETTEXT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3913
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3914
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3915
#ifdef WM_SYNCPAINT
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3916
	case WM_SYNCPAINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3917
	    EVENT_PRINTF(("WM_SYNCPAINT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3918
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3919
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3920
	case 0x88:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3921
	    EVENT_PRINTF(("0x88 (undoc)\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3922
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3923
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3924
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3925
	case WM_NCCALCSIZE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3926
	    EVENT_PRINTF(("WM_NCCALCSIZE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3927
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3928
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3929
	case WM_NCPAINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3930
	    EVENT_PRINTF3(("WM_NCPAINT\n"));
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3931
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3932
#ifdef THIS_DOES_NOT_WORK
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3933
	    /* mhmh - something is drawn, but clipped wrong
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3934
	     * and with wrong colors ....
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3935
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3936
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
	     * child windows only ...
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
	    if (GetParent(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3941
		int clr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3942
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3943
		clr = GetWindow_bdColor(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3944
		if (clr != BlackPixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3945
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3946
		     * draw it here
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
		    HBRUSH br;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3949
		    RECT rect, lineRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3950
		    HDC hDC;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3951
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3952
		    if (clr == WhitePixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3953
			br = __whiteBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3954
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3955
			br = CreateSolidBrush(clr);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3956
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3957
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3958
		    GetWindowRect(hWnd, &rect);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3959
		    hDC = GetWindowDC(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3960
		    SelectClipRgn(hDC, NULL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3961
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3962
		    lineRect.left = rect.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3963
		    lineRect.right = rect.right;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3964
		    lineRect.top = rect.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3965
		    lineRect.bottom = rect.top + 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3966
		    FillRect(hDC, &lineRect, br);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3967
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3968
		    lineRect.bottom = rect.bottom - 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3969
		    lineRect.bottom = rect.bottom;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3970
		    FillRect(hDC, &lineRect, br);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3971
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3972
		    lineRect.top = rect.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3973
		    lineRect.bottom = rect.bottom;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3974
		    lineRect.left = rect.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3975
		    lineRect.right = rect.left + 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3976
		    FillRect(hDC, &lineRect, br);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3977
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3978
		    lineRect.left = rect.right - 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3979
		    lineRect.right = rect.right;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3980
		    FillRect(hDC, &lineRect, br);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3981
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3982
		    _DeleteBrush(br, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3983
		    ReleaseDC(hWnd, hDC);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3984
		    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3985
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3986
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3987
	    }
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3988
#endif /* THIS_DOES_NOT_WORK */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3989
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3990
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3991
	case WM_SYSCOMMAND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3992
	    switch (wParam & ~0x000F) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3993
		case SC_CLOSE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3994
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3995
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3996
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3997
		case SC_MOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3998
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3999
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4000
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4001
		case SC_RESTORE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4002
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4003
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4004
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4005
		case SC_SIZE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4006
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4007
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4008
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4009
		default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4010
		    EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4011
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4012
	    }
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
	case WM_INITMENU:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4016
	    EVENT_PRINTF(("WM_INITMENU\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4017
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4018
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4019
	case WM_INITMENUPOPUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4020
	    EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4021
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4022
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4023
	case WM_ENTERIDLE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4024
	    EVENT_PRINTF(("WM_ENTERIDLE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4025
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4026
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4027
	case WM_ENTERMENULOOP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4028
	    EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4029
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4030
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4031
	case WM_EXITMENULOOP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4032
	    EVENT_PRINTF(("WM_EXITMENULOOP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4033
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4034
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4035
	case WM_MENUSELECT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4036
	    EVENT_PRINTF(("WM_MENUSELECT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4037
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4038
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4039
	case WM_QUIT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4040
	    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
  4041
	    enqEvent(0, 0, WM_QUIT, wParam, lParam, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4042
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4043
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4044
	case WM_NCDESTROY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4045
	    EVENT_PRINTF(("WM_NCDESTROY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4046
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4047
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4048
	case WM_QUERYNEWPALETTE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4049
	    EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4050
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4051
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4052
	case WM_PALETTECHANGED:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4053
	    EVENT_PRINTF(("WM_PALETTECHANGED\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4054
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4055
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4056
	case WM_ACTIVATEAPP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4057
	    EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4058
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4059
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4060
	case WM_SYSDEADCHAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4061
	    EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4062
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4063
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4064
	case WM_DEADCHAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4065
	    EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4066
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4067
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4068
	case WM_PAINTICON:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4069
	    EVENT_PRINTF(("WM_PAINTICON\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4070
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4071
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4072
	case WM_ICONERASEBKGND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4073
	    EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4074
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4075
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4076
	case WM_WINDOWPOSCHANGING:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4077
	    DPRINTFIF(__debug_WM_WINDOWPOSCHANGING__ , ("WM_WINDOWPOSCHANGING\n"));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4078
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4079
#ifdef HANDLE_VIEWGRAVITY
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4080
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4081
	     * any child with a viewGravity ?
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4082
	     * (only care for topViews here;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4083
	     *  child views do it on the smalltalk level ...)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4084
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4085
	    if (GetParent(hWnd) == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4086
		if (GetParent(hWnd) == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4087
		    struct gravityCallBackInfo i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4088
		    RECT rct, dRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4089
		    int dW, dH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4090
		    WINDOWPOS *wp = (WINDOWPOS *)lParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4091
		    int winStyleBits, winExStyleBits;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4092
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4093
		    if (! (wp->flags & SWP_NOSIZE)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4094
			dRect.left = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4095
			dRect.top = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4096
			dRect.right = 100;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4097
			dRect.bottom = 100;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4098
			winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4099
			winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4100
			AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4101
			dW = dRect.right - dRect.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4102
			dH = dRect.bottom - dRect.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4103
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4104
			GetClientRect(hWnd, &rct);
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
			i.parent = hWnd;
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.currW = rct.right - rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4109
			i.currH = rct.bottom - rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4110
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4111
			/* wp gives us the new outer (frame) bounds */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4112
			i.newW = wp->cx - (dW - 100);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4113
			i.newH = wp->cy - (dH - 100);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4114
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4115
			if ((i.currW != i.newW)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4116
			 || (i.currH != i.newH)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4117
			    DPRINTF((stderr, "about to sizeChange old: %d/%d new: %d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4118
				    i.currW, i.currH, i.newW, i.newH));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4119
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4120
			    GetWindowRect(hWnd, &rct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4121
			    i.parentWinX = rct.left - dRect.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4122
			    i.parentWinY = rct.top - dRect.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4123
			    EnumChildWindows(hWnd, gravityEnumeratorCallBack, (int)(&i));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4124
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4125
		    }
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
	    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4128
#endif /* HANDLE_VIEWGRAVITY */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4129
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4130
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4131
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4132
	case WM_QUERYOPEN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4133
	    EVENT_PRINTF(("WM_QUERYOPEN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4134
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4135
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4136
	case WM_QUERYENDSESSION:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4137
	    EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4138
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4139
	    if (@global(CanEndSession) == false) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4140
		enqEvent(0, hWnd, WM_QUERYENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4141
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4142
		// TODO: enter new event loop
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4143
		// which is left when an endSessionConfirmation
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4144
		// arrives from smalltalk
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4145
		// (either positive or negative).
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4146
		// for now, do not allow leaving
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4147
		// windows as long as ST/X is open.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4148
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4149
		return(0);
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(TRUE);  // allow leaving windows
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4152
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4153
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4154
	case WM_ENDSESSION:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4155
	    EVENT_PRINTF(("WM_ENDSESSION\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4156
	    enqEvent(0, hWnd, WM_ENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4157
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4158
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4159
	case WM_DISPLAYCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4160
	    EVENT_PRINTF(("WM_DISPLAYCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4161
	    enqEvent(0, hWnd, WM_DISPLAYCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4162
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4163
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4164
	case WM_FONTCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4165
	    EVENT_PRINTF(("WM_FONTCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4166
	    enqEvent(0, hWnd, WM_FONTCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4167
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4168
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4169
	case WM_WININICHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4170
	    EVENT_PRINTF(("WM_WININICHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4171
	    enqEvent(0, hWnd, WM_WININICHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4172
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4173
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4174
	case WM_SYSCOLORCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4175
	    EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4176
	    enqEvent(0, hWnd, WM_SYSCOLORCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4177
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4178
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4179
	case WM_MOVING:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4180
	    DPRINTFIF(__debug_WM_MOVING__ , ("WM_MOVING\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4181
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4182
	    inMove = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4183
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4184
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4185
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4186
	case WM_SIZING:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4187
	    EVENT_PRINTF(("WM_SIZING\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4188
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4189
	    inSize = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4190
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4191
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4192
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4193
	case WM_ENTERSIZEMOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4194
	    EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4195
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4196
	    inSizeMove = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4197
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4198
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4199
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4200
	case WM_EXITSIZEMOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4201
	    EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  4202
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  4203
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4204
	    if (inMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4205
		/* generate WM_WINDOWPOSCHANGED
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4206
		*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4207
		RECT rct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4208
		int x, y, w, h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4209
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4210
		GetClientRect(hWnd, &rct);
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
		x = rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4213
		y = rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4214
		w = rct.right - rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4215
		h = rct.bottom - rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4216
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4217
		if ((w == 0) && (h == 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4218
		    if (! GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4219
			SetWindow_iconified(hWnd, 1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4220
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4221
		    enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4222
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4223
		    if (GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4224
			SetWindow_iconified(hWnd, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4225
			enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4226
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4227
			enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4228
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4229
		}
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
#endif
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
	    inSizeMove = inMove = inSize = 0;
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
	    if (needDelayedMouseLeaveWindow || needDelayedMouseEnterWindow) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4236
		int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4237
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4238
		if (needDelayedMouseLeaveWindow) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4239
		    if (GetWindow_eventMask(needDelayedMouseLeaveWindow) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4240
			enqEvent(LeaveWindowMask, needDelayedMouseLeaveWindow, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4241
			SetWindow_mouseXY(needDelayedMouseLeaveWindow, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4242
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4243
		    needDelayedMouseLeaveWindow = NULL;
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
		if (needDelayedMouseEnterWindow) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4246
		    if (GetWindow_eventMask(needDelayedMouseEnterWindow) & EnterWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4247
			enqEvent(EnterWindowMask, needDelayedMouseEnterWindow, __WM_MOUSEENTER, 0, delayedMouseEnterX, delayedMouseEnterY, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4248
			SetWindow_mouseXY(needDelayedMouseEnterWindow, delayedMouseEnterX, delayedMouseEnterY);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4249
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4250
		    needDelayedMouseEnterWindow = NULL;
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
	    }
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
	    break;
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
	case WM_MOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4257
	    EVENT_PRINTF(("WM_MOVE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4258
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4259
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4260
	case WM_POWER:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4261
	    EVENT_PRINTF(("WM_POWER\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4262
	    enqEvent(0, hWnd, WM_POWER, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4263
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4264
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4265
	/* native widget actions */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4266
	case WM_COMMAND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4267
	    if (lParam) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4268
		NDPRINTF(("COMMAND for widget\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4269
		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
  4270
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4271
		NDPRINTF(("COMMAND for owner\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4272
		enqEvent(0, hWnd, WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4273
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4274
	    break;
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
	/* tray action */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4277
	case WM_TRAY_MESSAGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4278
	    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
  4279
	    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
  4280
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4281
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4282
	case WM_COPYDATA:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4283
	    DPRINTFIF(__debug_WM_COPYDATA__ , ("WM_COPYDATA\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4284
	    {
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4285
		PCOPYDATASTRUCT pCDs = (PCOPYDATASTRUCT) lParam;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4286
		int dwData = pCDs->dwData;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4287
		int nBytes = pCDs->cbData;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4288
		void *pData = pCDs->lpData;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4289
		void *pCopiedData;
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4290
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4291
		DPRINTFIF(__debug_WM_COPYDATA__ , ("WM_COPYDATA %d %lx\n", nBytes, pData));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4292
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4293
		/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4294
		 * 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
  4295
		 * area. This MUST be free'd by someone else !
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4296
		 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4297
		if (nBytes) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4298
		    pCopiedData = malloc(nBytes);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4299
		    memcpy(pCopiedData, pData, nBytes);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4300
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4301
		    pCopiedData = NULL;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4302
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4303
		//     (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4304
		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
  4305
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4306
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4307
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4308
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4309
	case WM_HSCROLL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4310
	case WM_VSCROLL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4311
	    NDPRINTF(("VM_*SCROLL\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4312
	    enqEvent(0, hWnd, message, wParam, lParam, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4313
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4314
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4315
	case WM_DRAWITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4316
	    EVENT_PRINTF(("WM_DRAWITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4317
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4318
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4319
		DRAWITEMSTRUCT *pItemStruct;
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
		pItemStruct = (DRAWITEMSTRUCT *)lParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4322
		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
  4323
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4324
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4325
	    break;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  4326
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  4327
#ifdef TRACE_ALL_EVENTS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4328
	case WM_CTLCOLORMSGBOX:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4329
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORMSGBOX\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4330
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4331
	case WM_CTLCOLOREDIT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4332
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLOREDIT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4333
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4334
	case WM_CTLCOLORLISTBOX:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4335
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORLISTBOX\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4336
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4337
	case WM_CTLCOLORBTN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4338
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORBTN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4339
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4340
	case WM_CTLCOLORDLG:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4341
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORDLG\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4342
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4343
	case WM_CTLCOLORSTATIC:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4344
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORSTATIC\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4345
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4346
	case WM_CTLCOLORSCROLLBAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4347
	    UNHANDLED_EVENT_PRINTFIF(__debug_WM_CTLCOLORSCROLLBAR__, ("WM_CTLCOLORSCROLLBAR\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4348
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4349
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4350
	case WM_STYLECHANGING:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4351
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4352
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4353
	case WM_STYLECHANGED:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4354
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4355
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4356
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4357
	case WM_GETICON:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4358
	    UNHANDLED_EVENT_PRINTFIF(__debug_WM_GETICON__, ("WM_GETICON\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4359
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4360
	case WM_SETICON:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4361
	    UNHANDLED_EVENT_PRINTF(("WM_SETICON\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4362
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4363
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4364
	case WM_PRINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4365
	    UNHANDLED_EVENT_PRINTF(("WM_PRINT(lParam=%d)\n", lParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4366
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4367
	case WM_PRINTCLIENT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4368
	    UNHANDLED_EVENT_PRINTF(("WM_PRINTCLIENT(lParam=%d)\n", lParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4369
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4370
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4371
	case WM_NULL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4372
	    UNHANDLED_EVENT_PRINTF(("WM_NULL\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4373
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4374
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4375
	case WM_ENABLE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4376
	    UNHANDLED_EVENT_PRINTF(("WM_ENABLE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4377
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4378
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4379
	case WM_SETREDRAW:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4380
	    UNHANDLED_EVENT_PRINTF(("WM_SETREDRAW\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4381
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4382
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4383
	case WM_DEVMODECHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4384
	    UNHANDLED_EVENT_PRINTF(("WM_DEVMODECHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4385
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4386
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4387
	case WM_TIMECHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4388
	    UNHANDLED_EVENT_PRINTF(("WM_TIMECHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4389
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4390
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4391
	case WM_CANCELMODE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4392
	    UNHANDLED_EVENT_PRINTF(("WM_CANCELMODE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4393
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4394
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4395
	case WM_CHILDACTIVATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4396
	    UNHANDLED_EVENT_PRINTF(("WM_CHILDACTIVATE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4397
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4398
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4399
	case WM_QUEUESYNC:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4400
	    UNHANDLED_EVENT_PRINTF(("WM_QUEUESYNC\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4401
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4402
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4403
	case WM_NEXTDLGCTL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4404
	    UNHANDLED_EVENT_PRINTF(("WM_NEXTDLGCTL\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4405
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4406
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4407
	case WM_SPOOLERSTATUS:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4408
	    UNHANDLED_EVENT_PRINTF(("WM_SPOOLERSTATUS\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4409
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4410
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4411
	case WM_MEASUREITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4412
	    UNHANDLED_EVENT_PRINTF(("WM_MEASUREITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4413
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4414
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4415
	case WM_DELETEITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4416
	    UNHANDLED_EVENT_PRINTF(("WM_DELETEITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4417
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4418
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4419
	case WM_VKEYTOITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4420
	    UNHANDLED_EVENT_PRINTF(("WM_VKEYTOITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4421
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4422
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4423
	case WM_CHARTOITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4424
	    UNHANDLED_EVENT_PRINTF(("WM_CHARTOITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4425
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4426
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4427
	case WM_SETFONT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4428
	    UNHANDLED_EVENT_PRINTF(("WM_SETFONT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4429
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4430
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4431
	case WM_GETFONT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4432
	    UNHANDLED_EVENT_PRINTF(("WM_GETFONT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4433
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4434
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4435
	case WM_SETHOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4436
	    UNHANDLED_EVENT_PRINTF(("WM_SETHOTKEY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4437
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4438
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4439
	case WM_GETHOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4440
	    UNHANDLED_EVENT_PRINTF(("WM_GETHOTKEY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4441
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4442
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4443
	case WM_QUERYDRAGICON:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4444
	    UNHANDLED_EVENT_PRINTF(("WM_QUERYDRAGICON\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4445
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4446
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4447
	case WM_COMPAREITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4448
	    UNHANDLED_EVENT_PRINTF(("WM_COMPAREITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4449
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4450
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4451
	case WM_GETOBJECT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4452
	    UNHANDLED_EVENT_PRINTF(("WM_GETOBJECT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4453
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4454
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4455
	case WM_COMPACTING:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4456
	    UNHANDLED_EVENT_PRINTF(("WM_COMPACTING\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4457
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4458
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4459
	case WM_COMMNOTIFY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4460
	    UNHANDLED_EVENT_PRINTF(("WM_COMMNOTIFY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4461
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4462
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4463
	case WM_CANCELJOURNAL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4464
	    UNHANDLED_EVENT_PRINTF(("WM_CANCELJOURNAL\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4465
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4466
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4467
	case WM_INPUTLANGCHANGEREQUEST:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4468
	    UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGEREQUEST\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4469
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4470
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4471
	case WM_INPUTLANGCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4472
	    UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4473
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4474
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4475
	case WM_TCARD:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4476
	    UNHANDLED_EVENT_PRINTF(("WM_TCARD\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4477
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4478
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4479
	case WM_HELP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4480
	    UNHANDLED_EVENT_PRINTF(("WM_HELP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4481
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4482
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4483
	case WM_USERCHANGED:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4484
	    UNHANDLED_EVENT_PRINTF(("WM_USERCHANGED\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4485
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4486
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4487
	case WM_NOTIFY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4488
	    UNHANDLED_EVENT_PRINTF(("WM_NOTIFY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4489
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4490
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4491
	case WM_NOTIFYFORMAT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4492
	    UNHANDLED_EVENT_PRINTF(("WM_NOTIFYFORMAT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4493
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4494
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4495
	case WM_CONTEXTMENU:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4496
	    UNHANDLED_EVENT_PRINTF(("WM_CONTEXTMENU\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4497
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4498
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4499
	case WM_NCXBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4500
	    UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDOWN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4501
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4502
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4503
	case WM_NCXBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4504
	    UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONUP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4505
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4506
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4507
	case WM_NCXBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4508
	    UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDBLCLK\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4509
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4510
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4511
	case WM_DEVICECHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4512
	    UNHANDLED_EVENT_PRINTF(("WM_DEVICECHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4513
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4514
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4515
	case DBT_DEVICEARRIVAL:
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4516
	    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
  4517
	    break;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4518
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4519
	case DBT_DEVICEREMOVECOMPLETE:
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4520
	    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
  4521
	    break;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4522
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4523
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4524
	default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4525
	    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
  4526
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4527
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4528
    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4529
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4530
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4531
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4532
static void _USERENTRY
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4533
dispatchThread(void *arg)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4534
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4535
    static int th_calls;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4536
    RECT rect;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4537
    MSG msg;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4538
    localWindowInfo *lI;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4539
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4540
    _dispatchThreadId2 = GetCurrentThreadId();
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4541
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  4542
    console_fprintf(stderr, "WinWorkstation [info]: dispatchThreadID2=%x\n", _dispatchThreadId2);
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4543
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4544
    TH_DPRINTF(("TS %d\n", th_calls++));
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4545
    PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE);   /* must be */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4546
4444
8d6a48c51edc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  4547
#if 0
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4548
    if (AttachThreadInput(_masterThreadId, _dispatchThreadId2, TRUE) != TRUE) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4549
	console_fprintf(stderr, "WinWorkstation [warning]: AttachThreadInput failed\n");
4443
96e956cf9acf plugin stuff now in librun
Claus Gittinger <cg@exept.de>
parents: 4441
diff changeset
  4550
    };
4444
8d6a48c51edc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  4551
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4552
#ifndef WIN32THREADS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4553
# if 0
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4554
    SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4555
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4556
# endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4557
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4558
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4559
    GetWindowRect(GetDesktopWindow(), &rect);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4560
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4561
    lI = (localWindowInfo *)malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4562
    if (lI) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4563
	memset(lI, 0, sizeof(*lI));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4564
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4565
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4566
    __rootWinSpezial = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT,
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4567
				      wapp_nameRoot, wapp_nameRoot,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4568
				      WS_POPUP | WS_DISABLED,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4569
				      0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4570
				      rect.right - rect.left, rect.bottom - rect.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4571
				      0, 0, (HANDLE) __getHInstance(), lI);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4572
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  4573
    //ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  4574
    SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4575
		 SWP_NOSENDCHANGING |
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4576
		 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4577
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4578
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  4579
    console_fprintf(stderr, "WinWorkstation [info]: setting ThreadRunningEvent\n");
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4580
#endif
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4581
    SetEvent(hDispatchThreadRunningEvent);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4582
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4583
    for (;;) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4584
	HANDLE dummy;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4585
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4586
	TH_DPRINTF(("TG %d\n", th_calls++));
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
	/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4589
	 * if there is no current capture (pointer-grab),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4590
	 * make certain that we do not get stuck in the GetMessage
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4591
	 * but instead poll the mouse in 200ms intervals.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4592
	 * This is required to synthesize the MOUSELEAVE message,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4593
	 */
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4594
// DPRINTF(("X1\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4595
	if (__currentPointerView && (__currentCapture == CAPTURE_NONE)) {
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4596
// DPRINTF(("X2\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4597
	    while (PeekMessageW(&msg, 0, 0, 0, PM_NOREMOVE) == 0) {
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4598
// DPRINTF(("PeekMessage -> 0\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4599
		/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4600
		 * wait for an event; timeout after 200 millis
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
		if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4603
		    if (! inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4604
			/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4605
			 * timeout - see where mouse pointer is
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4606
			 * for synthetic leave events.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4607
			 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4608
			POINT point;
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
			if (GetCursorPos(&point)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4611
			    HWND hWnd = WindowFromPoint(point);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4612
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4613
			    if (hWnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4614
				if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId()) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4615
				    if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4616
					if (needDelayedMouseLeaveWindow == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4617
					    needDelayedMouseLeaveWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4618
					}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4619
				    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4620
					if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4621
					    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4622
					    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4623
					}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4624
				    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4625
				    __currentPointerView = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4626
				    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4627
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4628
			    }
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
	GetMessageW(&msg, NULL, 0, 0);
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4636
// DPRINTF(("GetMessage -> %d\n", msg.message));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4637
	TH_DPRINTF(("TD %d\n", th_calls++));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4638
	destroyWin = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4639
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4640
	switch (msg.message) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4641
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4642
	    case WM_THREAD_DESTROYWINDOW:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4643
		destroyWin = TRUE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4644
		msg.message = WM_CLOSE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4645
		EVENT_PRINTF(("thread WM_THREAD_DESTROYWINDOW %x\n",msg.hwnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4646
		break;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4647
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4648
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4649
#ifdef SET_FOCUS_IN_WINTHREAD
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4650
	    case WM_THREAD_SETFOCUS:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  4651
		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
  4652
# ifdef xxWIN32THREADS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4653
		if (msg.lParam) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4654
		    if (AttachThreadInput(_dispatchThreadId2,msg.lParam,TRUE) == FALSE)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4655
			PRINTF(("SetFocus AttachThreadInput error %d\n", GetLastError()));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4656
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4657
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4658
		EVENT_PRINTF(("threadSetfocus %x\n",msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4659
		if (SetFocus((HWND)msg.wParam) == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4660
		    DDPRINTF(("SetFocus to %x failed.\n",msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4661
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4662
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4663
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4664
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4665
#ifdef SET_CURSOR_IN_WINTHREAD
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4666
	    case WM_THREAD_SETCURSOR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4667
		if (msg.lParam) {
5517
3581c9a93da6 Remove obsolete win95 stuff
Stefan Vogel <sv@exept.de>
parents: 5515
diff changeset
  4668
#if 1
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4669
		    SetCursor((HCURSOR)msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4670
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4671
		    /* this check is done by our sender */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4672
		    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4673
			POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4674
			GetCursorPos(&p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4675
			if (WindowFromPoint(p) == msg.hwnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4676
			    EVENT_PRINTF(("threadSetCursor %x\n",msg.lParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4677
			    SetCursor((HCURSOR)msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4678
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4679
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4680
#endif
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
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4683
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4684
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4685
#ifdef BEEP_IN_WINTHREAD
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4686
	    case WM_THREAD_BEEP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4687
		MessageBeep( MB_ICONEXCLAMATION);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4688
		continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4689
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4690
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4691
	    case WM_THREAD_SETCAPTURE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4692
		if (msg.wParam) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4693
		    if (__currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4694
			if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4695
			    if (needDelayedMouseLeaveWindow == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4696
				needDelayedMouseLeaveWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4697
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4698
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4699
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4700
				enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4701
				SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4702
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4703
			}
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
		    __currentPointerView = (HWND)msg.wParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4707
		    __currentCapture = CAPTURE_EXPLICIT;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4708
		    EVENT_PRINTF(("threadSetCapture %x\n",msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4709
		    SetCapture(__currentPointerView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4710
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4711
		    if (__currentPointerView  == __rootWinSpezial) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4712
			//ShowWindow(__rootWinSpezial, SW_HIDE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4713
			SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4714
				     SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4715
				     | SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4716
				   /*| SWP_NOZORDER | SWP_NOOWNERZORDER */);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4717
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4718
		    __currentPointerView = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4719
		    __currentCapture = CAPTURE_NONE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4720
		    EVENT_PRINTF(("threadReleaseCapture\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4721
		    ReleaseCapture();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4722
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4723
		if (msg.lParam) {
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  4724
		    DDDDPRINTF(("threadSetCursor %x\n",msg.lParam));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4725
		    SetCursor((HCURSOR)msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4726
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4727
		continue;
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
	    case WM_THREAD_CREATEWINDOW:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4730
		EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW %d\n", th_calls));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4731
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4732
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4733
		    createWindowInfo *cwi = (createWindowInfo *)(msg.lParam);
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
		    if ((cwi->sequenceNr == msg.wParam)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4736
		     && (cwi->sequenceNr != INVALIDATED_CWI)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4737
			cwi->sequenceNr = INVALIDATED_CWI;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4738
			cwi->infoWasRead = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4739
			if (cwi->newWinHandle == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4740
			    HANDLE ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4741
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4742
			    cwi->newWinHandle = CreateWindowExW(
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4743
						cwi->winStyleBitsEx,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4744
						cwi->className,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4745
						cwi->windowName,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4746
						cwi->winStyleBits,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4747
						cwi->x, cwi->y,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4748
						cwi->dx, cwi->dy,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4749
						cwi->parentHandle,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4750
						NULL,           /* menu */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4751
						(HANDLE) __getHInstance(),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4752
						cwi->localWindowInfo
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4753
					       );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4754
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4755
			    if (cwi->newWinHandle == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4756
				cwi->errCode = GetLastError();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4757
				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
  4758
						cwi->className, cwi->errCode, cwi->errCode, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4759
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4760
				SETLOCALWINDOWINFOPTR(cwi->newWinHandle, cwi->localWindowInfo);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  4761
#ifdef DEBUG /* PARANOIA */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4762
				if (GETLOCALWINDOWINFOPTR(cwi->newWinHandle) != cwi->localWindowInfo) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4763
				   console_fprintf(stderr, "lI-Error\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4764
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4765
#endif
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
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4768
			    ev = cwi->hCreateEvent;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4769
			    if (ev) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4770
				SetEvent(ev);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4771
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4772
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4773
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4774
			DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4775
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4776
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4777
		continue;
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
	    case WM_THREAD_REGISTERHOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4780
		EVENT_PRINTF(("*WM_THREAD_REGISTERHOTKEY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4781
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4782
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4783
		    registerHotKeyInfo *rhki = (registerHotKeyInfo *)(msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4784
		    if (!RegisterHotKey(rhki->hwnd,rhki->hotKeyId,rhki->modifier,rhki->virtualKey)){
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4785
			console_fprintf(stderr, "WinWorkstation [error]: RegisterHotKey failed: err=%d\n", GetLastError() );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4786
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4787
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4788
		continue;
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
	    case WM_THREAD_UNREGISTERHOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4791
		EVENT_PRINTF(("*WM_THREAD_UNREGISTERHOTKEY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4792
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4793
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4794
		    registerHotKeyInfo *rhki = (registerHotKeyInfo *)(msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4795
		    if (!UnregisterHotKey(rhki->hwnd,rhki->hotKeyId)){
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4796
			console_fprintf(stderr, "WinWorkstation [error]: UnegisterHotKey failed: err=%d\n", GetLastError() );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4797
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4798
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4799
		continue;
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
	    case WM_KEYDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4802
		DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN %x\n", msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4803
		goto commonKey;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4804
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4805
	    case WM_KEYUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4806
		DPRINTFIF(__debug_WM_KEYUP__  , ("WM_KEYUP %x\n", msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4807
		goto commonKey;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4808
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4809
	    case WM_SYSKEYDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4810
		DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n", msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4811
		goto commonKey;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4812
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4813
	    case WM_SYSKEYUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4814
		DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n", msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4815
		goto commonKey;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4816
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4817
	    case WM_HOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4818
		// 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
  4819
		DPRINTFIF(__debug_WM_KEYUP__ , ("WM_HOTKEY %x\n", msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4820
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4821
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4822
	    commonKey:
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
  4823
#if 1
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4824
		if (((msg.wParam >= '0') && (msg.wParam <= 'Z'))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4825
		 || ((msg.wParam >= VK_MULTIPLY) && (msg.wParam <= VK_DIVIDE))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4826
		 || (msg.wParam == VK_SPACE)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4827
		 || (msg.wParam == VK_CAPITAL)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4828
		 /* || (msg.wParam == VK_SHIFT) */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4829
		 || (msg.wParam >= 0xB0))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4830
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4831
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4832
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4833
		     * translate to a WM_CHAR message
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
		    if (TranslateMessage(&msg))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4836
			continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4837
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4838
		break;
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
	    /* short cirquit some messages */
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  4841
#if 0
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  4842
# ifndef SUPPORT_NATIVE_WINDOWS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4843
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4844
	     * some can simply be ignored ...
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
	    case WM_ERASEBKGND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4847
		EVENT_PRINTF(("*WM_ERASEBKGND\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4848
		continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4849
	    case WM_KILLFOCUS:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4850
		EVENT_PRINTF(("*WM_KILLFOCUS\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4851
		continue;
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  4852
# endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4853
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4854
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4855
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4856
	    case WM_SIZE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4857
		EVENT_PRINTF(("*WM_SIZE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4858
		continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4859
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4860
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4861
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
	 * common ...
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
	evRootX = msg.pt.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4866
	evRootY = msg.pt.y;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4867
#if 1
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4868
	{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4869
	    POINT p;
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
	    if (GetCursorPos(&p)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4872
		evRootX = p.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4873
		evRootY = p.y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4874
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4875
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4876
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4877
	lastMSGTime = msg.time;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4878
	DispatchMessageW(&msg);   /* Dispatches message to window */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4879
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4880
}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4881
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4882
LONG APIENTRY
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4883
MainWndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4884
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4885
    int wantDefault = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4886
    int retVal;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4887
    createWindowInfo *cwi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4888
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4889
    TH_DPRINTF(("TMW %d\n",message));
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4890
    EVENT_PRINTF3(("MainWndProc %d\n",message));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4891
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4892
     * kludge while in sizeMove loop, which
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4893
     * is performed directly by DefWindowProc
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  4894
     * 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
  4895
     * 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
  4896
     */
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  4897
    cwi = pendingCREATEWINDOWInfo;
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  4898
    if (cwi) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4899
	int dummyWantDefault;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4900
	int seqNr = pendingSequenceNr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4901
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4902
	pendingCREATEWINDOWInfo = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4903
	pendingSequenceNr = INVALIDATED_CWI;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4904
	DPRINTF(("### THREAD_CREATEWINDOW\n"));
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
  4905
	winEventProcessing(0, WM_THREAD_CREATEWINDOW, seqNr, (INT)cwi, &dummyWantDefault);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4906
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4907
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4908
    retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4909
    if (wantDefault) {
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  4910
	DDDPRINTF((">>DefWindowProc\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4911
	retVal = DefWindowProcW(hWnd, message, wParam, lParam);
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  4912
	DDDPRINTF(("<<DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4913
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4914
    return retVal;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4915
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4916
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4917
static int CALLBACK
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  4918
EnumWindowsProc(HWND hwnd, LPARAM lParam)
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4919
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4920
	volatile OBJ *refToCollection;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4921
	OBJ collection;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4922
	OBJ wHandle;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4923
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4924
	if (hwnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4925
	    refToCollection = (OBJ*) lParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4926
	    __PROTECT__(*refToCollection);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4927
	    wHandle = __MKEXTERNALADDRESS(hwnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4928
	    __UNPROTECT__(*refToCollection);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4929
	    collection = *refToCollection;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4930
	    __SSEND1( collection, @symbol(add:), 0, wHandle );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4931
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4932
	return TRUE;
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4933
}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4934
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4935
#ifdef USE_EnumFontFamiliesEx
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4936
# define LOGFONTTYPE  ENUMLOGFONTEX
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4937
#else
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4938
# define LOGFONTTYPE  LOGFONT
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4939
#endif
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4940
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4941
static int CALLBACK
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4942
EnumFPTypeFaceProc(
7614
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  4943
    const LOGFONTTYPE *lplf,   /* ptr to of logical-font data */
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  4944
    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
  4945
    DWORD dwType,              /* font type */
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  4946
    LPARAM lpData              /* application supplied data */
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4947
) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4948
	OBJ t;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4949
	volatile OBJ *refToList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4950
	OBJ  typeFaceList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4951
	char *faceNameString;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4952
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4953
	if (lplf) {
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  4954
	    refToList = (OBJ *) lpData;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4955
	    __PROTECT__(*refToList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4956
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4957
#ifdef USE_EnumFontFamiliesEx
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4958
	    faceNameString = lplf->elfLogFont.lfFaceName;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4959
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4960
	    faceNameString = lplf->lfFaceName;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4961
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4962
	    t = __MKSTRING( faceNameString );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4963
	    __UNPROTECT__(*refToList);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4964
	    typeFaceList = *refToList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4965
	    __SSEND1( typeFaceList, @symbol(add:), 0, t );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4966
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4967
	return 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4968
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4969
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4970
/*
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4971
 * take a LOGFONT structure and extract relevant data into a smalltalk array.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4972
 *
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4973
 * Returned value is:
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4974
 *      #(
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4975
 *          1   lfHeight
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4976
 *          2   lfWidth
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4977
 *          3   lfEscapement
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4978
 *          4   lfOrientation
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4979
 *          5   lfWeight (Integer)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4980
 *          6   lfWeight (String)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4981
 *          7   lfItalic
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4982
 *          8   lfUnderline
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4983
 *          9   lfStrikeOut
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4984
 *         10   lfCharSet (Integer)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4985
 *         11   lfOutPrecision
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4986
 *         12   lfClipPrecision
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4987
 *         13   lfQuality
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4988
 *         14   lfPitchAndFamily
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4989
 *         15   face and style name (String i.e. "bold-roman")
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4990
 *         16   face name from windows
4014
Claus Gittinger <cg@exept.de>
parents: 4013
diff changeset
  4991
 *         17   character encoding lfCharSet (as String i.e. "ms_ansi", "ms_oem", "ms_cyrillic")
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4992
 *         18
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4993
 *         19
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4994
 *         20
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4995
 *       )
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4996
 * 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
  4997
 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  4998
OBJ
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  4999
__charSetSymbolFor(int charSet)
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5000
{
5576
1887b5235bf5 Use @symbol() instead of __MKSYMBOL() for constant symbols
Stefan Vogel <sv@exept.de>
parents: 5575
diff changeset
  5001
    OBJ s;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5002
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5003
    switch (charSet) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5004
	case ANSI_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5005
	    s = @symbol('ms-ansi');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5006
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5007
	case DEFAULT_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5008
	    s = @symbol('ms-default');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5009
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5010
	case SYMBOL_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5011
	    s = @symbol('ms-symbol');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5012
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5013
	case SHIFTJIS_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5014
	    s = @symbol('ms-shiftjis');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5015
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5016
	case GB2312_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5017
	    s = @symbol('ms-gb2312');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5018
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5019
	case HANGEUL_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5020
	    s = @symbol('ms-hangeul');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5021
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5022
# if defined(HANGUL_CHARSET) && (HANGUL_CHARSET != HANGEUL_CHARSET)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5023
	case HANGUL_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5024
	    s = @symbol('ms-hangul');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5025
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5026
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5027
	case CHINESEBIG5_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5028
	    s = @symbol('ms-chinesebig5');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5029
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5030
	case OEM_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5031
	    s = @symbol('ms-oem');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5032
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5033
# ifdef JOHAB_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5034
	case JOHAB_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5035
	    s = @symbol('ms-johab');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5036
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5037
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5038
# ifdef HEBREW_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5039
	case HEBREW_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5040
	    s = @symbol('ms-hebrew');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5041
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5042
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5043
# ifdef ARABIC_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5044
	case ARABIC_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5045
	    s = @symbol('ms-arabic');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5046
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5047
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5048
# ifdef GREEK_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5049
	case GREEK_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5050
	    s = @symbol('ms-greek');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5051
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5052
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5053
# ifdef TURKISH_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5054
	case TURKISH_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5055
	    s = @symbol('ms-turkish');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5056
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5057
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5058
# ifdef RUSSIAN_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5059
	case RUSSIAN_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5060
	    s = @symbol('ms-russian');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5061
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5062
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5063
# ifdef EASTEUROPE_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5064
	case EASTEUROPE_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5065
	    s = @symbol('ms-easteurope');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5066
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5067
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5068
# ifdef BALTIC_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5069
	case BALTIC_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5070
	    s = @symbol('ms-baltic');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5071
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5072
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5073
# ifdef VIETNAMESE_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5074
	case VIETNAMESE_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5075
	    s = @symbol('ms-vietnamese');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5076
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5077
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5078
# ifdef THAI_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5079
	case THAI_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5080
	    s = @symbol('ms-thai');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5081
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5082
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5083
# ifdef MAC_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5084
	case MAC_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5085
	    s = @symbol('ms-mac');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5086
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5087
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5088
# ifdef UNICODE_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5089
	case UNICODE_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5090
	    s = @symbol('ms-unicode');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5091
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5092
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5093
	default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5094
	    s = @symbol(unknown);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5095
	    break;
5576
1887b5235bf5 Use @symbol() instead of __MKSYMBOL() for constant symbols
Stefan Vogel <sv@exept.de>
parents: 5575
diff changeset
  5096
    }
1887b5235bf5 Use @symbol() instead of __MKSYMBOL() for constant symbols
Stefan Vogel <sv@exept.de>
parents: 5575
diff changeset
  5097
    return s;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5098
}
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5099
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5100
OBJ
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  5101
__extractLogicalFontParameters(LOGFONT *lplf)
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5102
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5103
	OBJ newArray, t;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5104
	OBJ s;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5105
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5106
	DPRINTF((" lfHeight          %d\n", lplf->lfHeight ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5107
	DPRINTF((" lfWidth           %d\n", lplf->lfWidth  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5108
	DPRINTF((" lfEscapement      %d\n", lplf->lfEscapement  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5109
	DPRINTF((" lfOrientation     %d\n", lplf->lfOrientation  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5110
	DPRINTF((" lfWeight          %d\n", lplf->lfWeight  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5111
	DPRINTF((" lfItalic          %d\n", lplf->lfItalic  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5112
	DPRINTF((" lfUnderline       %d\n", lplf->lfUnderline  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5113
	DPRINTF((" lfStrikeOut       %d\n", lplf->lfStrikeOut  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5114
	DPRINTF((" lfCharSet         %d\n", lplf->lfCharSet  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5115
	DPRINTF((" lfOutPrecision    %d\n", lplf->lfOutPrecision  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5116
	DPRINTF((" lfClipPrecision   %d\n", lplf->lfClipPrecision  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5117
	DPRINTF((" lfQuality         %d\n", lplf->lfQuality  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5118
	DPRINTF((" lfPitchAndFamily  %d\n", lplf->lfPitchAndFamily  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5119
	DPRINTF((" lfFaceName        %s\n\n", lplf->lfFaceName  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5120
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5121
	newArray = __ARRAY_NEW_INT(20);
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
	__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5124
	__ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5125
	__ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5126
	__ArrayInstPtr(newArray)->a_element[3] = __MKSMALLINT(lplf->lfOrientation);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5127
	__ArrayInstPtr(newArray)->a_element[4] = __MKSMALLINT(lplf->lfWeight);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5128
	switch (lplf->lfWeight) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5129
	    case FW_HEAVY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5130
	    case FW_EXTRABOLD:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5131
	    case FW_SEMIBOLD:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5132
	    case FW_BOLD:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5133
		s = @symbol(bold);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5134
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5135
	    case FW_NORMAL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5136
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5137
		s = @symbol(normal);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5138
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5139
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5140
	    case FW_MEDIUM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5141
		s = @symbol(medium);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5142
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5143
	    case FW_THIN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5144
	    case FW_EXTRALIGHT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5145
	    case FW_LIGHT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5146
		s = @symbol(demi);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5147
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5148
	    default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5149
		s = @symbol(other);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5150
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5151
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5152
	__ArrayInstPtr(newArray)->a_element[5] = s; __STORE(newArray, s);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5153
	__ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfItalic);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5154
	__ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfUnderline);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5155
	__ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfStrikeOut);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5156
	__ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfCharSet);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5157
	__ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfOutPrecision);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5158
	__ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfClipPrecision);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5159
	__ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfQuality);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5160
	__ArrayInstPtr(newArray)->a_element[13] = __MKSMALLINT(lplf->lfPitchAndFamily);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5161
	/* ... */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5162
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5163
	if( lplf->lfItalic == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5164
	    if( lplf->lfUnderline == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5165
		if( lplf->lfStrikeOut == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5166
		    s = @symbol('italic-underline-strikeOut');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5167
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5168
		    s = @symbol('italic-underline');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5169
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5170
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5171
		if( lplf->lfStrikeOut == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5172
		    s = @symbol('italic-strikeOut');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5173
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5174
		    s = @symbol('italic');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5175
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5176
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5177
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5178
	    if( lplf->lfUnderline == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5179
		if( lplf->lfStrikeOut == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5180
		    s = @symbol('roman-underline-strikeOut');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5181
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5182
		    s = @symbol('roman-underline');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5183
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5184
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5185
		if( lplf->lfStrikeOut == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5186
		    s = @symbol('roman-strikeOut');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5187
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5188
		    s = @symbol('roman');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5189
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5190
	    }
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
	__ArrayInstPtr(newArray)->a_element[14] = s; __STORE(newArray, s);
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
	__PROTECT__(newArray);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5195
	t = __MKSTRING(lplf->lfFaceName);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5196
	__UNPROTECT__(newArray);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5197
	__ArrayInstPtr(newArray)->a_element[15] = t; __STORE(newArray, t);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5198
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5199
	t = __charSetSymbolFor(lplf->lfCharSet);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5200
	__ArrayInstPtr(newArray)->a_element[16] = t; __STORE(newArray, t);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5201
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5202
	return newArray;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5203
}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5204
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5205
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5206
static int CALLBACK
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5207
EnumFontsProc(
7614
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  5208
    const LOGFONTTYPE *lplf,   // ptr to of logical-font data
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  5209
    const TEXTMETRIC *lptm,    // ptr to physical font data
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  5210
    DWORD dwType,              // font type
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  5211
    LPARAM lpData              // application supplied data
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5212
) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5213
	volatile OBJ *refToList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5214
	OBJ list;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5215
	OBJ infoArray;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5216
	OBJ *fullName;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5217
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5218
	DPRINTF(("EnumFontsProc\n"));
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
	if ( lplf ) {
7614
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  5221
	    refToList = (OBJ *) lpData;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5222
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5223
	    __PROTECT__(*refToList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  5224
#ifdef USE_EnumFontFamiliesEx
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5225
	    infoArray = __extractLogicalFontParameters(lplf->elfLogFont);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5226
	    __PROTECT__(infoArray);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5227
	    fullName = __MKSTRING(lplf->elfFullName);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5228
	    __UNPROTECT__(infoArray);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5229
	    __ArrayInstPtr(infoArray)->a_element[17] = fullName; __STORE(infoArray, fullName);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5230
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5231
	    infoArray = __extractLogicalFontParameters(lplf);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5232
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5233
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5234
	    __UNPROTECT__(*refToList);
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
	    if ( dwType & TRUETYPE_FONTTYPE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5237
		/* change height to 0 to mark variable fonts */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5238
		__ArrayInstPtr(infoArray)->a_element[0] = __MKSMALLINT(0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5239
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5240
	    list = *refToList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5241
	    __SSEND1(list, @symbol(add:), 0, infoArray);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5242
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5243
	return 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5244
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5245
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5246
struct EnumDisplayMonitorsProcData {
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5247
    OBJ hArray;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5248
    int index;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5249
};
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5250
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5251
static int CALLBACK
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5252
EnumDisplayMonitorsProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM lpData)
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5253
{
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5254
    struct EnumDisplayMonitorsProcData *procData = (struct EnumDisplayMonitorsProcData *)lpData;
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5255
    OBJ mHandle;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5256
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5257
    __PROTECT__(procData->hArray);
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5258
    mHandle = __MKEXTERNALADDRESS(hMonitor);
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5259
    __UNPROTECT__(procData->hArray);
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5260
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5261
    __arrayVal(procData->hArray)[procData->index++] = mHandle;
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5262
    __STORE(procData->hArray, mHandle);
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5263
    return (1);
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5264
}
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5265
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5266
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5267
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5268
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5269
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5270
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5271
copyright
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5272
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5273
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5274
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5275
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5276
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5277
 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
  5278
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5279
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5280
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5281
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5282
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5283
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5284
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5285
documentation
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5286
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5287
    See more documentation in my superclass, DeviceWorkstation.
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
    [author:]
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  5290
	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
  5291
	Manfred Dierolf (many, many changes & fixes, multithreading etc.)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5292
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5293
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5294
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5295
!WinWorkstation class methodsFor:'initialization'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5296
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5297
initialize
5940
c7f52860ba82 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 5910
diff changeset
  5298
    "/ super initialize.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5299
    self initializeStandardColorNames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5300
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
  5301
    NativeWidgets := NativeDialogs := NativeFileDialogs := false.
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  5302
    BeepDuration := 200.        "milliseconds"
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5303
    ButtonTranslation := #(1 2 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5304
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  5305
    "/ SysColorChanges are reported *very* often when exceed is running,
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5306
    "/ 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
  5307
    "/ I don't know what exceed is doing there ...
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5308
    "/ IgnoreSysColorChanges := true.
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  5309
    IgnoreSysColorChanges := false.
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  5310
    SystemColorValues := IdentityDictionary new.
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5311
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5312
    "/ translation table from ST/X windowType symbol (system-independent)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5313
    "/ to Windows windowClass (windows-specific).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5314
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5315
    NativeWidgetClassTable := IdentityDictionary
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5316
	withKeysAndValues:#(
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5317
		ScrollBar                 SCROLLBAR
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5318
		HorizontalScrollBar       SCROLLBAR
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5319
		VerticalScrollBar         SCROLLBAR
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5320
		CheckBox                  BUTTON
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5321
		RadioButton               BUTTON
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5322
		Button                    BUTTON
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5323
		DefaultButton             BUTTON
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5324
		OwnerDrawButton           BUTTON
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5325
		ComboBox                  COMBOBOX
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5326
		EditField                 EDIT
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5327
		ListBox                   LISTBOX
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5328
	).
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
  5329
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
  5330
    "Modified: / 24-08-2010 / 16:42:23 / sr"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5331
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5332
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5333
initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5334
    "{ Pragma: +optSpace }"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5335
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5336
    "setup standard color names (X-color names)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5337
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5338
    StandardColorValues := Dictionary
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5339
	withKeysAndValues:#(
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5340
	    'aliceblue'     (240 248 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5341
	    'antiquewhite'  (250 235 215)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5342
	    'AntiqueWhite1' (255 239 219)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5343
	    'AntiqueWhite2' (238 223 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5344
	    'AntiqueWhite3' (205 192 176)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5345
	    'AntiqueWhite4' (139 131 120)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5346
	    'aquamarine'    (127 255 212)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5347
	    'aquamarine1'   (127 255 212)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5348
	    'aquamarine2'   (118 238 198)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5349
	    'aquamarine3'   (102 205 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5350
	    'aquamarine4'   (69 139 116)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5351
	    'azure'         (240 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5352
	    'azure1'        (240 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5353
	    'azure2'        (224 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5354
	    'azure3'        (193 205 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5355
	    'azure4'        (131 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5356
	    'beige'         (245 245 220)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5357
	    'bisque'        (255 228 196)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5358
	    'bisque1'       (255 228 196)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5359
	    'bisque2'       (238 213 183)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5360
	    'bisque3'       (205 183 158)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5361
	    'bisque4'       (139 125 107)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5362
	    'black'         (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5363
	    'blanchedalmond'        (255 235 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5364
	    'blue'          (0 0 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5365
	    'blueviolet'    (138 43 226)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5366
	    'blue1'         (0 0 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5367
	    'blue2'         (0 0 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5368
	    'blue3'         (0 0 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5369
	    'blue4'         (0 0 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5370
	    'brown'         (165 42 42)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5371
	    'brown1'        (255 64 64)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5372
	    'brown2'        (238 59 59)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5373
	    'brown3'        (205 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5374
	    'brown4'        (139 35 35)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5375
	    'burlywood'     (222 184 135)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5376
	    'burlywood1'    (255 211 155)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5377
	    'burlywood2'    (238 197 145)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5378
	    'burlywood3'    (205 170 125)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5379
	    'burlywood4'    (139 115 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5380
	    'cadetblue'     (95 158 160)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5381
	    'CadetBlue1'    (152 245 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5382
	    'CadetBlue2'    (142 229 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5383
	    'CadetBlue3'    (122 197 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5384
	    'CadetBlue4'    (83 134 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5385
	    'chartreuse'    (127 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5386
	    'chartreuse1'   (127 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5387
	    'chartreuse2'   (118 238 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5388
	    'chartreuse3'   (102 205 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5389
	    'chartreuse4'   (69 139 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5390
	    'chocolate'     (210 105 30)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5391
	    'chocolate1'    (255 127 36)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5392
	    'chocolate2'    (238 118 33)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5393
	    'chocolate3'    (205 102 29)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5394
	    'chocolate4'    (139 69 19)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5395
	    'coral'         (255 127 80)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5396
	    'coral1'        (255 114 86)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5397
	    'coral2'        (238 106 80)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5398
	    'coral3'        (205 91 69)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5399
	    'coral4'        (139 62 47)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5400
	    'cornflowerblue'        (100 149 237)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5401
	    'cornsilk'      (255 248 220)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5402
	    'cornsilk1'     (255 248 220)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5403
	    'cornsilk2'     (238 232 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5404
	    'cornsilk3'     (205 200 177)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5405
	    'cornsilk4'     (139 136 120)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5406
	    'cyan'          (0 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5407
	    'cyan1'         (0 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5408
	    'cyan2'         (0 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5409
	    'cyan3'         (0 205 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5410
	    'cyan4'         (0 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5411
	    'darkblue'      (0 0 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5412
	    'darkcyan'      (0 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5413
	    'darkgoldenrod' (184 134 11)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5414
	    'darkgray'      (169 169 169)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5415
	    'darkgreen'     (0 100 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5416
	    'darkgrey'      (169 169 169)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5417
	    'darkkhaki'     (189 183 107)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5418
	    'darkmagenta'   (139 0 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5419
	    'darkolivegreen'        (85 107 47)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5420
	    'darkorange'    (255 140 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5421
	    'darkorchid'    (153 50 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5422
	    'darkred'       (139 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5423
	    'darksalmon'    (233 150 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5424
	    'darkseagreen'  (143 188 143)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5425
	    'darkslateblue' (72 61 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5426
	    'darkslategray' (47 79 79)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5427
	    'darkslategrey' (47 79 79)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5428
	    'darkturquoise' (0 206 209)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5429
	    'darkviolet'    (148 0 211)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5430
	    'DarkGoldenrod1'        (255 185 15)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5431
	    'DarkGoldenrod2'        (238 173 14)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5432
	    'DarkGoldenrod3'        (205 149 12)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5433
	    'DarkGoldenrod4'        (139 101 8)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5434
	    'DarkOliveGreen1'       (202 255 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5435
	    'DarkOliveGreen2'       (188 238 104)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5436
	    'DarkOliveGreen3'       (162 205 90)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5437
	    'DarkOliveGreen4'       (110 139 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5438
	    'DarkOrange1'   (255 127 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5439
	    'DarkOrange2'   (238 118 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5440
	    'DarkOrange3'   (205 102 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5441
	    'DarkOrange4'   (139 69 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5442
	    'DarkOrchid1'   (191 62 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5443
	    'DarkOrchid2'   (178 58 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5444
	    'DarkOrchid3'   (154 50 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5445
	    'DarkOrchid4'   (104 34 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5446
	    'DarkSeaGreen1' (193 255 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5447
	    'DarkSeaGreen2' (180 238 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5448
	    'DarkSeaGreen3' (155 205 155)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5449
	    'DarkSeaGreen4' (105 139 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5450
	    'DarkSlateGray1'        (151 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5451
	    'DarkSlateGray2'        (141 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5452
	    'DarkSlateGray3'        (121 205 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5453
	    'DarkSlateGray4'        (82 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5454
	    'deeppink'      (255 20 147)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5455
	    'deepskyblue'   (0 191 255)
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
	    'DeepPink1'     (255 20 147)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5458
	    'DeepPink2'     (238 18 137)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5459
	    'DeepPink3'     (205 16 118)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5460
	    'DeepPink4'     (139 10 80)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5461
	    'DeepSkyBlue1'  (0 191 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5462
	    'DeepSkyBlue2'  (0 178 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5463
	    'DeepSkyBlue3'  (0 154 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5464
	    'DeepSkyBlue4'  (0 104 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5465
	    'dimgray'       (105 105 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5466
	    'dimgrey'       (105 105 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5467
	    'dodgerblue'    (30 144 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5468
	    'DodgerBlue1'   (30 144 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5469
	    'DodgerBlue2'   (28 134 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5470
	    'DodgerBlue3'   (24 116 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5471
	    'DodgerBlue4'   (16 78 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5472
	    'firebrick'     (178 34 34)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5473
	    'firebrick1'    (255 48 48)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5474
	    'firebrick2'    (238 44 44)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5475
	    'firebrick3'    (205 38 38)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5476
	    'firebrick4'    (139 26 26)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5477
	    'floralwhite'   (255 250 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5478
	    'forestgreen'   (34 139 34)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5479
	    'gainsboro'     (220 220 220)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5480
	    'ghostwhite'    (248 248 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5481
	    'gold'          (255 215 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5482
	    'gold1'         (255 215 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5483
	    'gold2'         (238 201 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5484
	    'gold3'         (205 173 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5485
	    'gold4'         (139 117 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5486
	    'goldenrod'     (218 165 32)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5487
	    'goldenrod1'    (255 193 37)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5488
	    'goldenrod2'    (238 180 34)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5489
	    'goldenrod3'    (205 155 29)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5490
	    'goldenrod4'    (139 105 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5491
	    'grey'          (192 192 192)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5492
	    'grey0'         (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5493
	    'grey1'         (3 3 3)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5494
	    'grey10'        (26 26 26)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5495
	    'grey100'       (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5496
	    'grey11'        (28 28 28)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5497
	    'grey12'        (31 31 31)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5498
	    'grey13'        (33 33 33)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5499
	    'grey14'        (36 36 36)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5500
	    'grey15'        (38 38 38)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5501
	    'grey16'        (41 41 41)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5502
	    'grey17'        (43 43 43)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5503
	    'grey18'        (46 46 46)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5504
	    'grey19'        (48 48 48)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5505
	    'grey2'         (5 5 5)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5506
	    'grey20'        (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5507
	    'grey21'        (54 54 54)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5508
	    'grey22'        (56 56 56)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5509
	    'grey23'        (59 59 59)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5510
	    'grey24'        (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5511
	    'grey25'        (64 64 64)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5512
	    'grey26'        (66 66 66)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5513
	    'grey27'        (69 69 69)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5514
	    'grey28'        (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5515
	    'grey29'        (74 74 74)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5516
	    'grey3'         (8 8 8)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5517
	    'grey30'        (77 77 77)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5518
	    'grey31'        (79 79 79)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5519
	    'grey32'        (82 82 82)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5520
	    'grey33'        (84 84 84)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5521
	    'grey34'        (87 87 87)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5522
	    'grey35'        (89 89 89)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5523
	    'grey36'        (92 92 92)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5524
	    'grey37'        (94 94 94)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5525
	    'grey38'        (97 97 97)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5526
	    'grey39'        (99 99 99)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5527
	    'grey4'         (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5528
	    'grey40'        (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5529
	    'grey41'        (105 105 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5530
	    'grey42'        (107 107 107)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5531
	    'grey43'        (110 110 110)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5532
	    'grey44'        (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5533
	    'grey45'        (115 115 115)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5534
	    'grey46'        (117 117 117)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5535
	    'grey47'        (120 120 120)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5536
	    'grey48'        (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5537
	    'grey49'        (125 125 125)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5538
	    'grey5'         (13 13 13)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5539
	    'grey50'        (127 127 127)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5540
	    'grey51'        (130 130 130)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5541
	    'grey52'        (133 133 133)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5542
	    'grey53'        (135 135 135)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5543
	    'grey54'        (138 138 138)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5544
	    'grey55'        (140 140 140)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5545
	    'grey56'        (143 143 143)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5546
	    'grey57'        (145 145 145)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5547
	    'grey58'        (148 148 148)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5548
	    'grey59'        (150 150 150)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5549
	    'grey6'         (15 15 15)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5550
	    'grey60'        (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5551
	    'grey61'        (156 156 156)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5552
	    'grey62'        (158 158 158)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5553
	    'grey63'        (161 161 161)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5554
	    'grey64'        (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5555
	    'grey65'        (166 166 166)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5556
	    'grey66'        (168 168 168)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5557
	    'grey67'        (171 171 171)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5558
	    'grey68'        (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5559
	    'grey69'        (176 176 176)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5560
	    'grey7'         (18 18 18)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5561
	    'grey70'        (179 179 179)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5562
	    'grey71'        (181 181 181)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5563
	    'grey72'        (184 184 184)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5564
	    'grey73'        (186 186 186)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5565
	    'grey74'        (189 189 189)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5566
	    'grey75'        (191 191 191)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5567
	    'grey76'        (194 194 194)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5568
	    'grey77'        (196 196 196)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5569
	    'grey78'        (199 199 199)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5570
	    'grey79'        (201 201 201)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5571
	    'grey8'         (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5572
	    'grey80'        (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5573
	    'grey81'        (207 207 207)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5574
	    'grey82'        (209 209 209)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5575
	    'grey83'        (212 212 212)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5576
	    'grey84'        (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5577
	    'grey85'        (217 217 217)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5578
	    'grey86'        (219 219 219)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5579
	    'grey87'        (222 222 222)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5580
	    'grey88'        (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5581
	    'grey89'        (227 227 227)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5582
	    'grey9'         (23 23 23)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5583
	    'grey90'        (229 229 229)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5584
	    'grey91'        (232 232 232)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5585
	    'grey92'        (235 235 235)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5586
	    'grey93'        (237 237 237)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5587
	    'grey94'        (240 240 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5588
	    'grey95'        (242 242 242)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5589
	    'grey96'        (245 245 245)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5590
	    'grey97'        (247 247 247)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5591
	    'grey98'        (250 250 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5592
	    'grey99'        (252 252 252)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5593
	    'gray'          (192 192 192)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5594
	    'gray0'         (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5595
	    'gray1'         (3 3 3)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5596
	    'gray10'        (26 26 26)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5597
	    'gray100'       (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5598
	    'gray11'        (28 28 28)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5599
	    'gray12'        (31 31 31)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5600
	    'gray13'        (33 33 33)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5601
	    'gray14'        (36 36 36)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5602
	    'gray15'        (38 38 38)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5603
	    'gray16'        (41 41 41)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5604
	    'gray17'        (43 43 43)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5605
	    'gray18'        (46 46 46)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5606
	    'gray19'        (48 48 48)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5607
	    'gray2'         (5 5 5)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5608
	    'gray20'        (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5609
	    'gray21'        (54 54 54)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5610
	    'gray22'        (56 56 56)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5611
	    'gray23'        (59 59 59)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5612
	    'gray24'        (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5613
	    'gray25'        (64 64 64)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5614
	    'gray26'        (66 66 66)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5615
	    'gray27'        (69 69 69)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5616
	    'gray28'        (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5617
	    'gray29'        (74 74 74)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5618
	    'gray3'         (8 8 8)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5619
	    'gray30'        (77 77 77)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5620
	    'gray31'        (79 79 79)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5621
	    'gray32'        (82 82 82)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5622
	    'gray33'        (84 84 84)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5623
	    'gray34'        (87 87 87)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5624
	    'gray35'        (89 89 89)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5625
	    'gray36'        (92 92 92)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5626
	    'gray37'        (94 94 94)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5627
	    'gray38'        (97 97 97)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5628
	    'gray39'        (99 99 99)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5629
	    'gray4'         (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5630
	    'gray40'        (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5631
	    'gray41'        (105 105 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5632
	    'gray42'        (107 107 107)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5633
	    'gray43'        (110 110 110)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5634
	    'gray44'        (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5635
	    'gray45'        (115 115 115)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5636
	    'gray46'        (117 117 117)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5637
	    'gray47'        (120 120 120)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5638
	    'gray48'        (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5639
	    'gray49'        (125 125 125)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5640
	    'gray5'         (13 13 13)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5641
	    'gray50'        (127 127 127)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5642
	    'gray51'        (130 130 130)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5643
	    'gray52'        (133 133 133)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5644
	    'gray53'        (135 135 135)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5645
	    'gray54'        (138 138 138)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5646
	    'gray55'        (140 140 140)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5647
	    'gray56'        (143 143 143)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5648
	    'gray57'        (145 145 145)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5649
	    'gray58'        (148 148 148)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5650
	    'gray59'        (150 150 150)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5651
	    'gray6'         (15 15 15)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5652
	    'gray60'        (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5653
	    'gray61'        (156 156 156)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5654
	    'gray62'        (158 158 158)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5655
	    'gray63'        (161 161 161)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5656
	    'gray64'        (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5657
	    'gray65'        (166 166 166)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5658
	    'gray66'        (168 168 168)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5659
	    'gray67'        (171 171 171)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5660
	    'gray68'        (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5661
	    'gray69'        (176 176 176)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5662
	    'gray7'         (18 18 18)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5663
	    'gray70'        (179 179 179)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5664
	    'gray71'        (181 181 181)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5665
	    'gray72'        (184 184 184)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5666
	    'gray73'        (186 186 186)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5667
	    'gray74'        (189 189 189)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5668
	    'gray75'        (191 191 191)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5669
	    'gray76'        (194 194 194)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5670
	    'gray77'        (196 196 196)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5671
	    'gray78'        (199 199 199)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5672
	    'gray79'        (201 201 201)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5673
	    'gray8'         (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5674
	    'gray80'        (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5675
	    'gray81'        (207 207 207)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5676
	    'gray82'        (209 209 209)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5677
	    'gray83'        (212 212 212)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5678
	    'gray84'        (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5679
	    'gray85'        (217 217 217)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5680
	    'gray86'        (219 219 219)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5681
	    'gray87'        (222 222 222)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5682
	    'gray88'        (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5683
	    'gray89'        (227 227 227)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5684
	    'gray9'         (23 23 23)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5685
	    'gray90'        (229 229 229)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5686
	    'gray91'        (232 232 232)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5687
	    'gray92'        (235 235 235)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5688
	    'gray93'        (237 237 237)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5689
	    'gray94'        (240 240 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5690
	    'gray95'        (242 242 242)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5691
	    'gray96'        (245 245 245)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5692
	    'gray97'        (247 247 247)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5693
	    'gray98'        (250 250 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5694
	    'gray99'        (252 252 252)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5695
	    'green'         (0 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5696
	    'greenyellow'   (173 255 47)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5697
	    'green1'        (0 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5698
	    'green2'        (0 238 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5699
	    'green3'        (0 205 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5700
	    'green4'        (0 139 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5701
	    'honeydew'      (240 255 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5702
	    'honeydew1'     (240 255 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5703
	    'honeydew2'     (224 238 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5704
	    'honeydew3'     (193 205 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5705
	    'honeydew4'     (131 139 131)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5706
	    'hotpink'       (255 105 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5707
	    'HotPink1'      (255 110 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5708
	    'HotPink2'      (238 106 167)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5709
	    'HotPink3'      (205 96 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5710
	    'HotPink4'      (139 58 98)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5711
	    'indianred'     (205 92 92)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5712
	    'IndianRed1'    (255 106 106)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5713
	    'IndianRed2'    (238 99 99)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5714
	    'IndianRed3'    (205 85 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5715
	    'IndianRed4'    (139 58 58)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5716
	    'ivory'         (255 255 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5717
	    'ivory1'        (255 255 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5718
	    'ivory2'        (238 238 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5719
	    'ivory3'        (205 205 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5720
	    'ivory4'        (139 139 131)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5721
	    'khaki'         (240 230 140)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5722
	    'khaki1'        (255 246 143)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5723
	    'khaki2'        (238 230 133)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5724
	    'khaki3'        (205 198 115)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5725
	    'khaki4'        (139 134 78)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5726
	    'lavender'      (230 230 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5727
	    'lavenderblush'         (255 240 245)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5728
	    'LavenderBlush1'        (255 240 245)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5729
	    'LavenderBlush2'        (238 224 229)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5730
	    'LavenderBlush3'        (205 193 197)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5731
	    'LavenderBlush4'        (139 131 134)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5732
	    'lawngreen'     (124 252 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5733
	    'lemonchiffon'  (255 250 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5734
	    'LemonChiffon1'         (255 250 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5735
	    'LemonChiffon2'         (238 233 191)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5736
	    'LemonChiffon3'         (205 201 165)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5737
	    'LemonChiffon4'         (139 137 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5738
	    'lightblue'     (173 216 230)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5739
	    'lightcoral'    (240 128 128)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5740
	    'lightcyan'     (224 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5741
	    'lightgoldenrod'        (238 221 130)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5742
	    'lightgoldenrodyellow'  (250 250 210)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5743
	    'lightgray'     (211 211 211)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5744
	    'lightgreen'    (144 238 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5745
	    'lightgrey'     (211 211 211)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5746
	    'lightpink'     (255 182 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5747
	    'lightsalmon'   (255 160 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5748
	    'lightseagreen' (32 178 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5749
	    'lightskyblue'  (135 206 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5750
	    'lightslateblue'        (132 112 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5751
	    'lightslategray'        (119 136 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5752
	    'lightslategrey'        (119 136 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5753
	    'lightsteelblue'        (176 196 222)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5754
	    'lightyellow'   (255 255 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5755
	    'LightBlue1'    (191 239 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5756
	    'LightBlue2'    (178 223 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5757
	    'LightBlue3'    (154 192 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5758
	    'LightBlue4'    (104 131 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5759
	    'LightCyan1'    (224 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5760
	    'LightCyan2'    (209 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5761
	    'LightCyan3'    (180 205 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5762
	    'LightCyan4'    (122 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5763
	    'LightGoldenrod1'       (255 236 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5764
	    'LightGoldenrod2'       (238 220 130)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5765
	    'LightGoldenrod3'       (205 190 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5766
	    'LightGoldenrod4'       (139 129 76)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5767
	    'LightPink1'    (255 174 185)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5768
	    'LightPink2'    (238 162 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5769
	    'LightPink3'    (205 140 149)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5770
	    'LightPink4'    (139 95 101)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5771
	    'LightSalmon1'  (255 160 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5772
	    'LightSalmon2'  (238 149 114)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5773
	    'LightSalmon3'  (205 129 98)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5774
	    'LightSalmon4'  (139 87 66)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5775
	    'LightSkyBlue1'         (176 226 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5776
	    'LightSkyBlue2'         (164 211 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5777
	    'LightSkyBlue3'         (141 182 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5778
	    'LightSkyBlue4'         (96 123 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5779
	    'LightSteelBlue1'       (202 225 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5780
	    'LightSteelBlue2'       (188 210 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5781
	    'LightSteelBlue3'       (162 181 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5782
	    'LightSteelBlue4'       (110 123 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5783
	    'LightYellow1'  (255 255 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5784
	    'LightYellow2'  (238 238 209)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5785
	    'LightYellow3'  (205 205 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5786
	    'LightYellow4'  (139 139 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5787
	    'limegreen'     (50 205 50)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5788
	    'linen'         (250 240 230)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5789
	    'magenta'       (255 0 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5790
	    'magenta1'      (255 0 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5791
	    'magenta2'      (238 0 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5792
	    'magenta3'      (205 0 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5793
	    'magenta4'      (139 0 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5794
	    'maroon'        (176 48 96)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5795
	    'maroon1'       (255 52 179)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5796
	    'maroon2'       (238 48 167)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5797
	    'maroon3'       (205 41 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5798
	    'maroon4'       (139 28 98)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5799
	    'mediumaquamarine'      (102 205 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5800
	    'mediumblue'    (0 0 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5801
	    'mediumorchid'  (186 85 211)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5802
	    'mediumpurple'  (147 112 219)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5803
	    'mediumseagreen'        (60 179 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5804
	    'mediumslateblue'       (123 104 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5805
	    'mediumspringgreen'     (0 250 154)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5806
	    'mediumturquoise'       (72 209 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5807
	    'mediumvioletred'       (199 21 133)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5808
	    'MediumOrchid1'         (224 102 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5809
	    'MediumOrchid2' (209 95 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5810
	    'MediumOrchid3' (180 82 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5811
	    'MediumOrchid4' (122 55 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5812
	    'MediumPurple1' (171 130 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5813
	    'MediumPurple2' (159 121 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5814
	    'MediumPurple3' (137 104 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5815
	    'MediumPurple4' (93 71 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5816
	    'midnightblue'  (25 25 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5817
	    'mintcream'     (245 255 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5818
	    'mistyrose'     (255 228 225)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5819
	    'MistyRose1'    (255 228 225)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5820
	    'MistyRose2'    (238 213 210)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5821
	    'MistyRose3'    (205 183 181)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5822
	    'MistyRose4'    (139 125 123)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5823
	    'moccasin'      (255 228 181)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5824
	    'navajowhite'   (255 222 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5825
	    'NavajoWhite1'  (255 222 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5826
	    'NavajoWhite2'  (238 207 161)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5827
	    'NavajoWhite3'  (205 179 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5828
	    'NavajoWhite4'  (139 121 94)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5829
	    'navy'          (0 0 128)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5830
	    'navyblue'      (0 0 128)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5831
	    'oldlace'       (253 245 230)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5832
	    'olivedrab'     (107 142 35)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5833
	    'OliveDrab1'    (192 255 62)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5834
	    'OliveDrab2'    (179 238 58)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5835
	    'OliveDrab3'    (154 205 50)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5836
	    'OliveDrab4'    (105 139 34)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5837
	    'orange'        (255 165 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5838
	    'orange1'       (255 165 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5839
	    'orange2'       (238 154 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5840
	    'orange3'       (205 133 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5841
	    'orange4'       (139 90 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5842
	    'orangered'     (255 69 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5843
	    'OrangeRed1'    (255 69 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5844
	    'OrangeRed2'    (238 64 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5845
	    'OrangeRed3'    (205 55 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5846
	    'OrangeRed4'    (139 37 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5847
	    'orchid'        (218 112 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5848
	    'orchid1'       (255 131 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5849
	    'orchid2'       (238 122 233)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5850
	    'orchid3'       (205 105 201)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5851
	    'orchid4'       (139 71 137)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5852
	    'palegoldenrod' (238 232 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5853
	    'palegreen'     (152 251 152)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5854
	    'paleturquoise' (175 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5855
	    'palevioletred' (219 112 147)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5856
	    'PaleGreen1'    (154 255 154)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5857
	    'PaleGreen2'    (144 238 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5858
	    'PaleGreen3'    (124 205 124)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5859
	    'PaleGreen4'    (84 139 84)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5860
	    'PaleTurquoise1'        (187 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5861
	    'PaleTurquoise2'        (174 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5862
	    'PaleTurquoise3'        (150 205 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5863
	    'PaleTurquoise4'        (102 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5864
	    'PaleVioletRed1'        (255 130 171)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5865
	    'PaleVioletRed2'        (238 121 159)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5866
	    'PaleVioletRed3'        (205 104 137)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5867
	    'PaleVioletRed4'        (139 71 93)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5868
	    'papayawhip'    (255 239 213)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5869
	    'peachpuff'     (255 218 185)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5870
	    'PeachPuff1'    (255 218 185)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5871
	    'PeachPuff2'    (238 203 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5872
	    'PeachPuff3'    (205 175 149)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5873
	    'PeachPuff4'    (139 119 101)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5874
	    'peru'  (205 133 63)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5875
	    'pink'  (255 192 203)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5876
	    'pink1' (255 181 197)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5877
	    'pink2' (238 169 184)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5878
	    'pink3' (205 145 158)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5879
	    'pink4' (139 99 108)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5880
	    'plum'  (221 160 221)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5881
	    'plum1' (255 187 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5882
	    'plum2' (238 174 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5883
	    'plum3' (205 150 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5884
	    'plum4' (139 102 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5885
	    'powderblue'    (176 224 230)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5886
	    'purple'        (160 32 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5887
	    'purple1'       (155 48 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5888
	    'purple2'       (145 44 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5889
	    'purple3'       (125 38 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5890
	    'purple4'       (85 26 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5891
	    'red'   (255 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5892
	    'red1'  (255 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5893
	    'red2'  (238 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5894
	    'red3'  (205 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5895
	    'red4'  (139 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5896
	    'rosybrown'     (188 143 143)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5897
	    'RosyBrown1'    (255 193 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5898
	    'RosyBrown2'    (238 180 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5899
	    'RosyBrown3'    (205 155 155)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5900
	    'RosyBrown4'    (139 105 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5901
	    'royalblue'     (65 105 225)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5902
	    'RoyalBlue1'    (72 118 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5903
	    'RoyalBlue2'    (67 110 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5904
	    'RoyalBlue3'    (58 95 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5905
	    'RoyalBlue4'    (39 64 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5906
	    'saddlebrown'   (139 69 19)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5907
	    'salmon'        (250 128 114)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5908
	    'salmon1'       (255 140 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5909
	    'salmon2'       (238 130 98)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5910
	    'salmon3'       (205 112 84)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5911
	    'salmon4'       (139 76 57)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5912
	    'sandybrown'    (244 164 96)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5913
	    'scoActiveBackground'   (255 206 137)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5914
	    'scoActiveForeground'   (43 45 49)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5915
	    'scoActiveTopShadow'    (254 222 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5916
	    'scoAltBackground'      (172 186 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5917
	    'scoBackground' (203 203 192)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5918
	    'scoForeground' (11 0 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5919
	    'scoHighlight'  (141 178 215)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5920
	    'scoTopShadow'  (255 240 248)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5921
	    'seagreen'      (46 139 87)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5922
	    'SeaGreen1'     (84 255 159)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5923
	    'SeaGreen2'     (78 238 148)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5924
	    'SeaGreen3'     (67 205 128)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5925
	    'SeaGreen4'     (46 139 87)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5926
	    'seashell'      (255 245 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5927
	    'seashell1'     (255 245 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5928
	    'seashell2'     (238 229 222)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5929
	    'seashell3'     (205 197 191)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5930
	    'seashell4'     (139 134 130)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5931
	    'sgi beet'      (142 56 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5932
	    'sgi bright gray'       (197 193 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5933
	    'sgi bright grey'       (197 193 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5934
	    'sgi chartreuse'        (113 198 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5935
	    'sgi dark gray' (85 85 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5936
	    'sgi dark grey' (85 85 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5937
	    'sgi gray 0'    (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5938
	    'sgi gray 100'  (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5939
	    'sgi gray 12'   (30 30 30)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5940
	    'sgi gray 16'   (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5941
	    'sgi gray 20'   (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5942
	    'sgi gray 24'   (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5943
	    'sgi gray 28'   (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5944
	    'sgi gray 32'   (81 81 81)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5945
	    'sgi gray 36'   (91 91 91)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5946
	    'sgi gray 4'    (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5947
	    'sgi gray 40'   (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5948
	    'sgi gray 44'   (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5949
	    'sgi gray 48'   (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5950
	    'sgi gray 52'   (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5951
	    'sgi gray 56'   (142 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5952
	    'sgi gray 60'   (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5953
	    'sgi gray 64'   (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5954
	    'sgi gray 68'   (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5955
	    'sgi gray 72'   (183 183 183)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5956
	    'sgi gray 76'   (193 193 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5957
	    'sgi gray 8'    (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5958
	    'sgi gray 80'   (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5959
	    'sgi gray 84'   (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5960
	    'sgi gray 88'   (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5961
	    'sgi gray 92'   (234 234 234)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5962
	    'sgi gray 96'   (244 244 244)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5963
	    'sgi grey 0'    (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5964
	    'sgi grey 100'  (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5965
	    'sgi grey 12'   (30 30 30)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5966
	    'sgi grey 16'   (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5967
	    'sgi grey 20'   (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5968
	    'sgi grey 24'   (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5969
	    'sgi grey 28'   (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5970
	    'sgi grey 32'   (81 81 81)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5971
	    'sgi grey 36'   (91 91 91)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5972
	    'sgi grey 4'    (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5973
	    'sgi grey 40'   (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5974
	    'sgi grey 44'   (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5975
	    'sgi grey 48'   (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5976
	    'sgi grey 52'   (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5977
	    'sgi grey 56'   (142 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5978
	    'sgi grey 60'   (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5979
	    'sgi grey 64'   (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5980
	    'sgi grey 68'   (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5981
	    'sgi grey 72'   (183 183 183)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5982
	    'sgi grey 76'   (193 193 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5983
	    'sgi grey 8'    (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5984
	    'sgi grey 80'   (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5985
	    'sgi grey 84'   (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5986
	    'sgi grey 88'   (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5987
	    'sgi grey 92'   (234 234 234)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5988
	    'sgi grey 96'   (244 244 244)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5989
	    'sgi light blue'        (125 158 192)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5990
	    'sgi light gray'        (170 170 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5991
	    'sgi light grey'        (170 170 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5992
	    'sgi medium gray'       (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5993
	    'sgi medium grey'       (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5994
	    'sgi olive drab'        (142 142 56)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5995
	    'sgi salmon'    (198 113 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5996
	    'sgi slate blue'        (113 113 198)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5997
	    'sgi teal'      (56 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5998
	    'sgi very dark gray'    (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5999
	    'sgi very dark grey'    (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6000
	    'sgi very light gray'   (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6001
	    'sgi very light grey'   (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6002
	    'SGIBeet'       (142 56 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6003
	    'SGIBrightGray' (197 193 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6004
	    'SGIBrightGrey' (197 193 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6005
	    'SGIChartreuse' (113 198 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6006
	    'SGIDarkGray'   (85 85 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6007
	    'SGIDarkGrey'   (85 85 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6008
	    'SGIGray0'      (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6009
	    'SGIGray100'    (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6010
	    'SGIGray12'     (30 30 30)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6011
	    'SGIGray16'     (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6012
	    'SGIGray20'     (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6013
	    'SGIGray24'     (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6014
	    'SGIGray28'     (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6015
	    'SGIGray32'     (81 81 81)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6016
	    'SGIGray36'     (91 91 91)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6017
	    'SGIGray4'      (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6018
	    'SGIGray40'     (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6019
	    'SGIGray44'     (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6020
	    'SGIGray48'     (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6021
	    'SGIGray52'     (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6022
	    'SGIGray56'     (142 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6023
	    'SGIGray60'     (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6024
	    'SGIGray64'     (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6025
	    'SGIGray68'     (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6026
	    'SGIGray72'     (183 183 183)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6027
	    'SGIGray76'     (193 193 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6028
	    'SGIGray8'      (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6029
	    'SGIGray80'     (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6030
	    'SGIGray84'     (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6031
	    'SGIGray88'     (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6032
	    'SGIGray92'     (234 234 234)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6033
	    'SGIGray96'     (244 244 244)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6034
	    'SGIGrey0'      (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6035
	    'SGIGrey100'    (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6036
	    'SGIGrey12'     (30 30 30)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6037
	    'SGIGrey16'     (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6038
	    'SGIGrey20'     (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6039
	    'SGIGrey24'     (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6040
	    'SGIGrey28'     (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6041
	    'SGIGrey32'     (81 81 81)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6042
	    'SGIGrey36'     (91 91 91)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6043
	    'SGIGrey4'      (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6044
	    'SGIGrey40'     (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6045
	    'SGIGrey44'     (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6046
	    'SGIGrey48'     (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6047
	    'SGIGrey52'     (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6048
	    'SGIGrey56'     (142 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6049
	    'SGIGrey60'     (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6050
	    'SGIGrey64'     (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6051
	    'SGIGrey68'     (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6052
	    'SGIGrey72'     (183 183 183)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6053
	    'SGIGrey76'     (193 193 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6054
	    'SGIGrey8'      (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6055
	    'SGIGrey80'     (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6056
	    'SGIGrey84'     (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6057
	    'SGIGrey88'     (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6058
	    'SGIGrey92'     (234 234 234)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6059
	    'SGIGrey96'     (244 244 244)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6060
	    'SGILightBlue'  (125 158 192)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6061
	    'SGILightGray'  (170 170 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6062
	    'SGILightGrey'  (170 170 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6063
	    'SGIMediumGray' (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6064
	    'SGIMediumGrey' (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6065
	    'SGIOliveDrab'  (142 142 56)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6066
	    'SGISalmon'     (198 113 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6067
	    'SGISlateBlue'  (113 113 198)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6068
	    'SGITeal'       (56 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6069
	    'SGIVeryDarkGray'       (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6070
	    'SGIVeryDarkGrey'       (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6071
	    'SGIVeryLightGray'      (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6072
	    'SGIVeryLightGrey'      (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6073
	    'sienna'        (160 82 45)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6074
	    'sienna1'       (255 130 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6075
	    'sienna2'       (238 121 66)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6076
	    'sienna3'       (205 104 57)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6077
	    'sienna4'       (139 71 38)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6078
	    'skyblue'       (135 206 235)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6079
	    'SkyBlue1'      (135 206 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6080
	    'SkyBlue2'      (126 192 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6081
	    'SkyBlue3'      (108 166 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6082
	    'SkyBlue4'      (74 112 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6083
	    'slategray'     (112 128 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6084
	    'slategrey'     (112 128 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6085
	    'slateblue'     (106 90 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6086
	    'SlateBlue1'    (131 111 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6087
	    'SlateBlue2'    (122 103 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6088
	    'SlateBlue3'    (105 89 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6089
	    'SlateBlue4'    (71 60 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6090
	    'SlateGray1'    (198 226 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6091
	    'SlateGray2'    (185 211 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6092
	    'SlateGray3'    (159 182 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6093
	    'SlateGray4'    (108 123 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6094
	    'snow'          (255 250 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6095
	    'snow1'         (255 250 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6096
	    'snow2'         (238 233 233)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6097
	    'snow3'         (205 201 201)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6098
	    'snow4'         (139 137 137)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6099
	    'springgreen'   (0 255 127)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6100
	    'SpringGreen1'  (0 255 127)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6101
	    'SpringGreen2'  (0 238 118)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6102
	    'SpringGreen3'  (0 205 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6103
	    'SpringGreen4'  (0 139 69)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6104
	    'steelblue'     (70 130 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6105
	    'SteelBlue1'    (99 184 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6106
	    'SteelBlue2'    (92 172 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6107
	    'SteelBlue3'    (79 148 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6108
	    'SteelBlue4'    (54 100 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6109
	    'tan'   (210 180 140)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6110
	    'tan1'  (255 165 79)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6111
	    'tan2'  (238 154 73)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6112
	    'tan3'  (205 133 63)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6113
	    'tan4'  (139 90 43)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6114
	    'thistle'       (216 191 216)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6115
	    'thistle1'      (255 225 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6116
	    'thistle2'      (238 210 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6117
	    'thistle3'      (205 181 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6118
	    'thistle4'      (139 123 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6119
	    'tomato'        (255 99 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6120
	    'tomato1'       (255 99 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6121
	    'tomato2'       (238 92 66)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6122
	    'tomato3'       (205 79 57)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6123
	    'tomato4'       (139 54 38)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6124
	    'turquoise'     (64 224 208)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6125
	    'turquoise1'    (0 245 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6126
	    'turquoise2'    (0 229 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6127
	    'turquoise3'    (0 197 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6128
	    'turquoise4'    (0 134 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6129
	    'violet'        (238 130 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6130
	    'violetred'     (208 32 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6131
	    'VioletRed1'    (255 62 150)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6132
	    'VioletRed2'    (238 58 140)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6133
	    'VioletRed3'    (205 50 120)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6134
	    'VioletRed4'    (139 34 82)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6135
	    'wheat'         (245 222 179)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6136
	    'wheat1'        (255 231 186)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6137
	    'wheat2'        (238 216 174)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6138
	    'wheat3'        (205 186 150)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6139
	    'wheat4'        (139 126 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6140
	    'white'         (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6141
	    'whitesmoke'    (245 245 245)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6142
	    'yellow'        (255 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6143
	    'yellowgreen'   (154 205 50)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6144
	    'yellow1'       (255 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6145
	    'yellow2'       (238 238 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6146
	    'yellow3'       (205 205 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6147
	    'yellow4'       (139 139 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6148
	).
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6149
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6150
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6151
     WinWorkstation initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6152
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6153
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6154
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6155
!WinWorkstation class methodsFor:'debugging'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6156
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6157
bitmapHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6158
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6159
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6160
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6161
#ifdef COUNT_BMP_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6162
    RETURN ( __MKSMALLINT(__cnt_bitmap));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6163
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6164
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6165
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6166
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6167
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6168
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6169
cursorHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6170
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6171
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6172
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6173
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6174
    RETURN ( __MKSMALLINT(__cnt_cur));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6175
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6176
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6177
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6178
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6179
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6180
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6181
debug
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6182
%{  /* NOCONTEXT */
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6183
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6184
    RETURN (__debug__ != 0 ? true : false);
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6185
%}
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6186
!
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6187
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6188
debug2
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6189
%{  /* NOCONTEXT */
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6190
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6191
    RETURN ((__debug__ & 2) != 0 ? true : false);
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
!
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6194
6007
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6195
debug2:aBoolean
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6196
    "enable more debug prints - this will vanish"
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6197
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6198
%{  /* NOCONTEXT */
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
    if (aBoolean == true) {
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6201
	__debug__ |= 2;
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6202
    } else {
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
    }
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6205
%}
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
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6208
debug4:aBoolean
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6209
    "enable even more debug prints - this will vanish"
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6210
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6211
%{  /* NOCONTEXT */
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6212
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6213
    if (aBoolean == true) {
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6214
	__debug__ |= 4;
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6215
    } else {
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
    }
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6218
%}
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
debug8:aBoolean
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6222
    "enable even more debug prints - this will vanish"
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6223
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6224
%{  /* NOCONTEXT */
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6225
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6226
    if (aBoolean == true) {
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6227
	__debug__ |= 8;
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6228
    } else {
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
    }
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6231
%}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6232
!
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6233
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6234
debug:aBoolean
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6235
    "enable/disable debug prints - this will vanish"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6236
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6237
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6238
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6239
    __debug__ = (aBoolean == true) ? 1 : 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6240
%}
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6241
    "
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6242
     WinWorkstation debug:true
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6243
     WinWorkstation debug:false
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6244
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6245
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6246
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6247
debug:aBoolean message:msg
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6248
    "enable/disable debugging of individual WM messages"
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6249
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6250
    msg = 'WM_ALL' ifTrue:[
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6251
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6252
	__debug_WM_ALL__ = (aBoolean == true);
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6253
	RETURN (self);
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6254
%}
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6255
    ].
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6256
    msg = 'WM_USER' ifTrue:[
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6257
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6258
	__debug_WM_MOUSEENTER__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6259
	__debug_WM_MOUSELEAVE__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6260
	__debug_WM_MOUSEMOVE__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6261
	__debug_WM_MOUSEACTIVATE__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6262
	__debug_WM_BUTTONUP__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6263
	__debug_WM_BUTTONDOWN__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6264
	__debug_WM_KEYUP__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6265
	__debug_WM_KEYDOWN__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6266
	__debug_WM_CHAR__ = (aBoolean == true);
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6267
	RETURN (self);
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6268
%}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6269
    ].
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6270
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6271
    msg = 'WM_MOUSEENTER' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6272
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6273
	__debug_WM_MOUSEENTER__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6274
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6275
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6276
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6277
    msg = 'WM_MOUSELEAVE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6278
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6279
	__debug_WM_MOUSELEAVE__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6280
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6281
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6282
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6283
    msg = 'WM_MOUSEMOVE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6284
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6285
	__debug_WM_MOUSEMOVE__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6286
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6287
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6288
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6289
    msg = 'WM_MOUSEACTIVATE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6290
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6291
	__debug_WM_MOUSEACTIVATE__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6292
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6293
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6294
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6295
    msg = 'WM_BUTTONUP' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6296
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6297
	__debug_WM_BUTTONUP__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6298
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6299
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6300
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6301
    msg = 'WM_BUTTONDOWN' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6302
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6303
	__debug_WM_BUTTONDOWN__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6304
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6305
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6306
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6307
    msg = 'WM_KEYUP' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6308
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6309
	__debug_WM_KEYUP__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6310
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6311
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6312
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6313
    msg = 'WM_KEYDOWN' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6314
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6315
	__debug_WM_KEYDOWN__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6316
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6317
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6318
    ].
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6319
    msg = 'WM_CHAR' ifTrue:[
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6320
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6321
	__debug_WM_CHAR__ = (aBoolean == true);
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6322
	RETURN (self);
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6323
%}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6324
    ].
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6325
    msg = 'WM_PAINT' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6326
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6327
	__debug_WM_PAINT__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6328
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6329
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6330
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6331
    msg = 'WM_MOVING' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6332
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6333
	__debug_WM_MOVING__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6334
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6335
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6336
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6337
    msg = 'WM_ERASEBKGND' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6338
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6339
	__debug_WM_ERASEBKGND__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6340
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6341
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6342
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6343
    msg = 'WM_SETTEXT' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6344
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6345
	__debug_WM_SETTEXT__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6346
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6347
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6348
    ].
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6349
    msg = 'WM_COPYDATA' ifTrue:[
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6350
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6351
	__debug_WM_COPYDATA__ = (aBoolean == true);
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6352
	RETURN (self);
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6353
%}
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6354
    ].
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6355
    msg = 'WM_DROPFILES' ifTrue:[
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6356
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6357
	__debug_WM_DROPFILES__ = (aBoolean == true);
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6358
	RETURN (self);
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6359
%}
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6360
    ].
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6361
    msg = 'WM_SHOWWINDOW' ifTrue:[
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6362
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6363
	__debug_WM_SHOWWINDOW__ = (aBoolean == true);
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6364
	RETURN (self);
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6365
%}
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6366
    ].
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6367
    msg = 'WM_SETCURSOR' ifTrue:[
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6368
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6369
	__debug_WM_SETCURSOR__ = (aBoolean == true);
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6370
	RETURN (self);
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6371
%}
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6372
    ].
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6373
    msg = 'WM_FOCUS' ifTrue:[
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6374
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6375
	__debug_WM_FOCUS__ = (aBoolean == true);
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6376
	RETURN (self);
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6377
%}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6378
    ].
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6379
    'unknown WM_x' infoPrintCR.
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6380
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6381
    "
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6382
     WinWorkstation debug:true
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6383
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6384
     WinWorkstation debug:false message:'WM_KEYUP'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6385
     WinWorkstation debug:false message:'WM_KEYDOWN'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6386
     WinWorkstation debug:false message:'WM_PAINT'
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  6387
     WinWorkstation debug:false message:'WM_BUTTONDOWN'
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6388
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6389
     WinWorkstation debug:true message:'WM_KEYUP'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6390
     WinWorkstation debug:true message:'WM_KEYDOWN'
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6391
     WinWorkstation debug:true message:'WM_CHAR'
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6392
     WinWorkstation debug:true message:'WM_COPYDATA'
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6393
    "
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  6394
!
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  6395
4248
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6396
debugNative
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6397
%{  /* NOCONTEXT */
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6398
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6399
    RETURN (__debugNative__ == 0 ? false : true);
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6400
%}
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6401
    "
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6402
     WinWorkstation debugNative
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6403
    "
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6404
!
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6405
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6406
debugNative:aBoolean
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6407
%{  /* NOCONTEXT */
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6408
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6409
    __debugNative__ = (aBoolean == true);
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6410
%}
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6411
    "
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6412
     WinWorkstation debugNative:true
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6413
     WinWorkstation debugNative:false
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6414
    "
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6415
!
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6416
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6417
fontHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6418
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6419
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6420
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6421
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6422
    RETURN ( __MKSMALLINT(__cnt_font));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6423
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6424
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6425
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6426
%}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6427
!
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
gcDataHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6430
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6431
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6432
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6433
#ifdef COUNT_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6434
    RETURN ( __MKSMALLINT(__cnt_gcData));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6435
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6436
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6437
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6438
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6439
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6440
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6441
printHandleCounts
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6442
   "show prim values"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6443
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6444
    'WINWORKSTATION: pWin=' print. self windowHandleCounts print.
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6445
    ' pBit=' print. self bitmapHandleCounts print.
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6446
    ' pGc=' print. self gcDataHandleCounts print.
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6447
    ' pCurs=' print. self cursorHandleCounts printCR
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6448
!
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6449
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6450
windowHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6451
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6452
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6453
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6454
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6455
    RETURN ( __MKSMALLINT(__cnt_createWindows));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6456
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6457
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6458
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6459
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6460
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6461
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6462
!WinWorkstation class methodsFor:'queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6463
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  6464
isWindowsPlatform
6376
73ebac4ef970 comment
Claus Gittinger <cg@exept.de>
parents: 6361
diff changeset
  6465
    "return true, if this device is a windows screen"
73ebac4ef970 comment
Claus Gittinger <cg@exept.de>
parents: 6361
diff changeset
  6466
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  6467
    ^ true
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  6468
!
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  6469
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6470
platformName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6471
    "ST-80 compatibility.
2777
60ba83db1fab comment
Claus Gittinger <cg@exept.de>
parents: 2766
diff changeset
  6472
     Return a string describing the display systems platform.
60ba83db1fab comment
Claus Gittinger <cg@exept.de>
parents: 2766
diff changeset
  6473
     WinWorkstation always returns 'WIN32'."
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6474
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6475
    ^ 'WIN32'
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6476
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6477
    "Modified: 26.5.1996 / 15:32:46 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6478
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6479
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6480
!WinWorkstation methodsFor:'accessing & queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6481
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6482
activateOnClick:aBoolean
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6483
    "set/clear the activateOnClick behavior.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6484
     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
  6485
     the window.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6486
     Windows users typically enable this;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6487
     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
  6488
     it disabled.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6489
     Returns the previous setting.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6490
     The default is true."
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6491
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6492
%{  /* NOCONTEXT */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6493
    OBJ rslt = __activateOnClick ? true : false;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6494
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6495
    if (aBoolean == true) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6496
       __activateOnClick = 1;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6497
    } else {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6498
       if (aBoolean == false) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6499
	   __activateOnClick = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6500
       }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6501
    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6502
    RETURN (rslt);
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
    "
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6505
     Display activateOnClick:true
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6506
     Display activateOnClick:false
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6507
    "
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6508
!
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6509
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6510
anyButtonMotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6511
    "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
  6512
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6513
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6514
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6515
    RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6516
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6517
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6518
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6519
blackpixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6520
    "return the colornumber of black"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6521
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6522
    ^ blackpixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6523
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6524
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6525
button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6526
    "return the state-mask for button1 in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6527
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6528
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6529
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6530
    RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6531
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6532
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
     Display button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6535
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6536
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6537
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6538
button2MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6539
    "return the state-mask for button2 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6540
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6541
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6542
%{  /* NOCONTEXT */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6543
    RETURN (__MKSMALLINT(Button2MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6544
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6545
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6546
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6547
button3MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6548
    "return the state-mask for button3 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6549
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6550
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6551
%{  /* NOCONTEXT */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6552
    RETURN (__MKSMALLINT(Button3MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6553
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6554
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6555
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6556
buttonMotionMask:aButton
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6557
    "return the state-mask for button1 in motion events state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6558
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6559
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6560
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6561
    if (aButton == __MKSMALLINT(1)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6562
	RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6563
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6564
    if (aButton == __MKSMALLINT(2)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6565
	RETURN (__MKSMALLINT(Button2MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6566
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6567
    if (aButton == __MKSMALLINT(3)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6568
	RETURN (__MKSMALLINT(Button3MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6569
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6570
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6571
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6572
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6573
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6574
controlMask
3261
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6575
    "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
  6576
     Obsolete"
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6577
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6578
%{  /* NOCONTEXT */
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6579
    RETURN (__MKSMALLINT(ControlMask));
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6580
%}
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6581
!
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
ctrlModifierMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6584
    "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
  6585
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6586
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6587
    RETURN (__MKSMALLINT(ControlMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6588
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6589
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6590
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6591
defaultEventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6592
    "return a mask to enable some events by default."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6593
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6594
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6595
    RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6596
			 KeyPressMask | KeyReleaseMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6597
			 EnterWindowMask | LeaveWindowMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6598
			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6599
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6600
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6601
5672
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6602
deviceContext
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6603
    ^ rootDC
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6604
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6605
    "Created: / 24-12-2010 / 10:44:40 / cg"
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6606
!
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6607
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6608
displayFileDescriptor
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6609
    "return the displays fileNumber for select, if any"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6610
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6611
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6612
   /* RETURN (nil);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6613
   RETURN ( __MKEXTERNALADDRESS(hInputEvent));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6614
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6615
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6616
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6617
displayName
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6618
    "return the display-connections display name.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6619
     For Windows, a dummy name is returned"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6620
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6621
    ^ 'local'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6622
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6623
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6624
focusFollowsMouse:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6625
    "set/clear the focusFollowsMouse behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6626
     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
  6627
     (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
  6628
      the groups focusView...).
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6629
     Windows users typically disable this;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6630
     users which are used to the X-Window system typically prefer
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6631
     it enabled.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6632
     Returns the previous setting.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6633
     The default is false."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6634
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6635
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6636
    OBJ rslt = __focusFollowsMouse ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6637
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6638
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6639
       __focusFollowsMouse = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6640
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6641
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6642
	   __focusFollowsMouse = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6643
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6644
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6645
    RETURN (rslt);
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
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6648
     WinWorkstation focusFollowsMouse:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6649
     WinWorkstation focusFollowsMouse:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6650
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6651
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6652
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6653
getSystemColor:aKey
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6654
    "retrieve a windows system color.
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6655
     The styleSheet/View classes may use this to setup default colors"
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6656
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  6657
    ^ SystemColorValues at:aKey ifAbsentPut:[self primGetSystemColor:aKey].
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6658
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6659
    "
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6660
     Display getSystemColor:#COLOR_WINDOW
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6661
     Display getSystemColor:#COLOR_HIGHLIGHT
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6662
    "
4809
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6663
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6664
    "Modified: / 30-10-2007 / 15:06:02 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6665
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6666
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6667
getSystemMetrics:aNumberOrSymbol
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6668
    "get a system metrics value;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6669
     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
  6670
     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
  6671
     which must be the define-value."
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6672
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6673
%{  /* NOCONTEXT */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6674
    int info = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6675
    int isBool = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6676
    int arg;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6677
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6678
    if (__isSmallInteger(aNumberOrSymbol)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6679
	arg = __intVal(aNumberOrSymbol);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6680
    } else if ((aNumberOrSymbol == @symbol(swapButton)) || (aNumberOrSymbol == @symbol(SM_SWAPBUTTON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6681
	arg = SM_SWAPBUTTON;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6682
	isBool = 1;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6683
    } else if ((aNumberOrSymbol == @symbol(mousePresent)) || (aNumberOrSymbol == @symbol(SM_MOUSEPRESENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6684
	arg = SM_MOUSEPRESENT;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6685
	isBool = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6686
    } else if ((aNumberOrSymbol == @symbol(mouseButtons)) || (aNumberOrSymbol == @symbol(SM_CMOUSEBUTTONS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6687
	arg = SM_CMOUSEBUTTONS;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6688
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6689
	arg = SM_CXICON;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6690
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6691
	arg = SM_CYICON;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  6692
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXDOUBLECLK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6693
	arg = SM_CXDOUBLECLK;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  6694
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYDOUBLECLK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6695
	arg = SM_CYDOUBLECLK;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6696
    } else if ((aNumberOrSymbol == @symbol(cursorWidth)) || (aNumberOrSymbol == @symbol(SM_CXCURSOR))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6697
	arg = SM_CXCURSOR;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6698
    } else if ((aNumberOrSymbol == @symbol(cursorHeight)) || (aNumberOrSymbol == @symbol(SM_CYCURSOR))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6699
	arg = SM_CYCURSOR;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6700
    } else if ((aNumberOrSymbol == @symbol(captionHeight)) || (aNumberOrSymbol == @symbol(SM_CYCAPTION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6701
	arg = SM_CYCAPTION;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6702
    } else if ((aNumberOrSymbol == @symbol(resizeFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6703
	arg = SM_CXFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6704
    } else if ((aNumberOrSymbol == @symbol(resizeFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6705
	arg = SM_CYFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6706
    } else if ((aNumberOrSymbol == @symbol(borderFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXBORDER))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6707
	arg = SM_CXBORDER;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6708
    } else if ((aNumberOrSymbol == @symbol(borderFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYBORDER))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6709
	arg = SM_CYBORDER;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6710
    } else if (aNumberOrSymbol == @symbol(SM_CXDLGFRAME)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6711
	arg = SM_CXDLGFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6712
    } else if (aNumberOrSymbol == @symbol(SM_CYDLGFRAME)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6713
	arg = SM_CYDLGFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6714
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXFULLSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6715
	arg = SM_CXFULLSCREEN;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6716
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYFULLSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6717
	arg = SM_CYFULLSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6718
    } else if ((aNumberOrSymbol == @symbol(screenWidth)) || (aNumberOrSymbol == @symbol(SM_CXSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6719
	arg = SM_CXSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6720
    } else if ((aNumberOrSymbol == @symbol(screenHeight)) || (aNumberOrSymbol == @symbol(SM_CYSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6721
	arg = SM_CYSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6722
    } else if ((aNumberOrSymbol == @symbol(minWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXMIN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6723
	arg = SM_CXMIN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6724
    } else if ((aNumberOrSymbol == @symbol(minWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYMIN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6725
	arg = SM_CYMIN;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6726
    } else if ((aNumberOrSymbol == @symbol(vScrollbarWidth)) || (aNumberOrSymbol == @symbol(SM_CXVSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6727
	arg = SM_CXVSCROLL;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6728
    } else if ((aNumberOrSymbol == @symbol(hScrollbarHeight)) || (aNumberOrSymbol == @symbol(SM_CYHSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6729
	arg = SM_CYHSCROLL;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6730
    } else if ((aNumberOrSymbol == @symbol(vThumbHeight)) || (aNumberOrSymbol == @symbol(SM_CYVTHUMB))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6731
	arg = SM_CYVTHUMB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6732
    } else if ((aNumberOrSymbol == @symbol(hThumbWidth)) || (aNumberOrSymbol == @symbol(SM_CXHTHUMB))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6733
	arg = SM_CXHTHUMB;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6734
    } else if ((aNumberOrSymbol == @symbol(SM_CXSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6735
	arg = SM_CXSIZE;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6736
    } else if ((aNumberOrSymbol == @symbol(SM_CYSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6737
	arg = SM_CYSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6738
    } else if ((aNumberOrSymbol == @symbol(SM_CYVSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6739
	arg = SM_CYVSCROLL;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6740
    } else if ((aNumberOrSymbol == @symbol(SM_CXHSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6741
	arg = SM_CXHSCROLL;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6742
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6743
	arg = SM_CXMINTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6744
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6745
	arg = SM_CYMINTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6746
    } else if ((aNumberOrSymbol == @symbol(SM_CXICONSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6747
	arg = SM_CXICONSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6748
    } else if ((aNumberOrSymbol == @symbol(SM_CYICONSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6749
	arg = SM_CYICONSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6750
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENU))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6751
	arg = SM_CYMENU;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6752
    } else if ((aNumberOrSymbol == @symbol(SM_MENUDROPALIGNMENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6753
	arg = SM_MENUDROPALIGNMENT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6754
    } else if ((aNumberOrSymbol == @symbol(SM_PENWINDOWS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6755
	arg = SM_PENWINDOWS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6756
    } else if ((aNumberOrSymbol == @symbol(SM_DBCSENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6757
	arg = SM_DBCSENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6758
    } else if ((aNumberOrSymbol == @symbol(SM_CXFIXEDFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6759
	arg = SM_CXFIXEDFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6760
    } else if ((aNumberOrSymbol == @symbol(SM_CYFIXEDFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6761
	arg = SM_CYFIXEDFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6762
    } else if ((aNumberOrSymbol == @symbol(SM_CXSIZEFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6763
	arg = SM_CXSIZEFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6764
    } else if ((aNumberOrSymbol == @symbol(SM_CYSIZEFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6765
	arg = SM_CYSIZEFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6766
    } else if ((aNumberOrSymbol == @symbol(SM_CYKANJIWINDOW))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6767
	arg = SM_CYKANJIWINDOW;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6768
    } else if ((aNumberOrSymbol == @symbol(SM_SECURE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6769
	arg = SM_SECURE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6770
    } else if ((aNumberOrSymbol == @symbol(SM_CXEDGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6771
	arg = SM_CXEDGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6772
    } else if ((aNumberOrSymbol == @symbol(SM_CYEDGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6773
	arg = SM_CYEDGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6774
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6775
	arg = SM_CXMINSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6776
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6777
	arg = SM_CYMINSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6778
    } else if ((aNumberOrSymbol == @symbol(SM_CXSMICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6779
	arg = SM_CXSMICON;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6780
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6781
	arg = SM_CYSMICON;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6782
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMCAPTION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6783
	arg = SM_CYSMCAPTION;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6784
    } else if ((aNumberOrSymbol == @symbol(SM_CXSMSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6785
	arg = SM_CXSMSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6786
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6787
	arg = SM_CYSMSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6788
    } else if ((aNumberOrSymbol == @symbol(SM_CXMENUSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6789
	arg = SM_CXMENUSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6790
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENUSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6791
	arg = SM_CYMENUSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6792
    } else if ((aNumberOrSymbol == @symbol(SM_ARRANGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6793
	arg = SM_ARRANGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6794
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6795
	arg = SM_CXMINIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6796
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6797
	arg = SM_CYMINIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6798
    } else if ((aNumberOrSymbol == @symbol(SM_CXMAXTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6799
	arg = SM_CXMAXTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6800
    } else if ((aNumberOrSymbol == @symbol(SM_CYMAXTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6801
	arg = SM_CYMAXTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6802
    } else if ((aNumberOrSymbol == @symbol(SM_CXMAXIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6803
	arg = SM_CXMAXIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6804
    } else if ((aNumberOrSymbol == @symbol(SM_CYMAXIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6805
	arg = SM_CYMAXIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6806
    } else if ((aNumberOrSymbol == @symbol(SM_NETWORK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6807
	arg = SM_NETWORK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6808
    } else if ((aNumberOrSymbol == @symbol(SM_CXDRAG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6809
	arg = SM_CXDRAG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6810
    } else if ((aNumberOrSymbol == @symbol(SM_CYDRAG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6811
	arg = SM_CYDRAG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6812
    } else if ((aNumberOrSymbol == @symbol(SM_NETWORK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6813
	arg = SM_NETWORK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6814
    } else if ((aNumberOrSymbol == @symbol(SM_SHOWSOUNDS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6815
	arg = SM_SHOWSOUNDS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6816
    } else if ((aNumberOrSymbol == @symbol(SM_CXMENUCHECK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6817
	arg = SM_CXMENUCHECK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6818
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENUCHECK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6819
	arg = SM_CYMENUCHECK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6820
    } else if ((aNumberOrSymbol == @symbol(SM_SLOWMACHINE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6821
	arg = SM_SLOWMACHINE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6822
    } else if ((aNumberOrSymbol == @symbol(SM_MIDEASTENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6823
	arg = SM_MIDEASTENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6824
    } else if ((aNumberOrSymbol == @symbol(SM_MOUSEWHEELPRESENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6825
	arg = SM_MOUSEWHEELPRESENT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6826
    } else if ((aNumberOrSymbol == @symbol(SM_XVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6827
	arg = SM_XVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6828
    } else if ((aNumberOrSymbol == @symbol(SM_YVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6829
	arg = SM_YVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6830
    } else if ((aNumberOrSymbol == @symbol(SM_CXVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6831
	arg = SM_CXVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6832
    } else if ((aNumberOrSymbol == @symbol(SM_CYVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6833
	arg = SM_CYVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6834
    } else if ((aNumberOrSymbol == @symbol(SM_CMONITORS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6835
	arg = SM_CMONITORS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6836
    } else if ((aNumberOrSymbol == @symbol(SM_SAMEDISPLAYFORMAT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6837
	arg = SM_SAMEDISPLAYFORMAT;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6838
#ifdef SM_IMMENABLED
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6839
    } else if ((aNumberOrSymbol == @symbol(SM_IMMENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6840
	arg = SM_IMMENABLED;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6841
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6842
    } else if ((aNumberOrSymbol == @symbol(SM_DEBUG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6843
	arg = SM_DEBUG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6844
#ifdef SM_REMOTESESSION
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6845
    } else if ((aNumberOrSymbol == @symbol(SM_REMOTESESSION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6846
	arg = SM_REMOTESESSION;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6847
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6848
    } else {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6849
	RETURN (nil);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6850
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6851
    info = GetSystemMetrics(arg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6852
    if (isBool) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6853
	RETURN (info ? true : false);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6854
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6855
    RETURN (__MKSMALLINT(info));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6856
%}
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6857
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6858
     Screen current getSystemMetrics:#SM_MOUSEWHEELPRESENT
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6859
     Screen current getSystemMetrics:#SM_ARRANGE
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6860
     Screen current getSystemMetrics:#SM_XVIRTUALSCREEN
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6861
     Screen current getSystemMetrics:#SM_CXVIRTUALSCREEN
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6862
     Screen current getSystemMetrics:#SM_CYVIRTUALSCREEN
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6863
     Screen current getSystemMetrics:#SM_CMONITORS
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6864
     Screen current getSystemMetrics:#SM_SAMEDISPLAYFORMAT
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  6865
     Screen current getSystemMetrics:81
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6866
    "
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6867
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6868
    "Modified: / 08-09-2006 / 15:36:32 / cg"
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6869
!
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6870
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6871
getSystemParametersInfo:aNumberOrSymbol
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6872
    "get a system parameter value;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6873
     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
  6874
     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
  6875
     which must be the define-value."
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6876
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6877
    | info menuFontInfoArray statusFontInfoArray messageFontInfoArray
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6878
      menuFont statusFont messageFont |
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6879
%{
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6880
    int retVal = 0;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6881
    int isBool = 0;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6882
    int isString = 0;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6883
    int isRect = 0;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6884
    int isNonClientInfo = 0;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6885
    int arg, param;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6886
    void *pRslt;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6887
    union {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6888
	char buffer[1024];
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6889
	RECT rect;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6890
	NONCLIENTMETRICS nc;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6891
    } rslt;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6892
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6893
    if (__isSmallInteger(aNumberOrSymbol)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6894
	arg = __intVal(aNumberOrSymbol);
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6895
#ifdef SPI_GETDESKWALLPAPER
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6896
    } else if (aNumberOrSymbol == @symbol(SPI_GETDESKWALLPAPER)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6897
	arg = SPI_GETDESKWALLPAPER;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6898
	isString = 1;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6899
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6900
#ifdef SPI_GETDROPSHADOW
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6901
    } else if (aNumberOrSymbol == @symbol(SPI_GETDROPSHADOW)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6902
	arg = SPI_GETDROPSHADOW;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6903
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6904
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6905
#ifdef SPI_GETFLATMENU
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6906
    } else if (aNumberOrSymbol == @symbol(SPI_GETFLATMENU)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6907
	arg = SPI_GETFLATMENU;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6908
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6909
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6910
#ifdef SPI_GETWHEELSCROLLLINES
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6911
    } else if (aNumberOrSymbol == @symbol(SPI_GETWHEELSCROLLLINES)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6912
	arg = SPI_GETWHEELSCROLLLINES;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6913
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6914
#ifdef SPI_GETHOTTRACKING
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6915
    } else if (aNumberOrSymbol == @symbol(SPI_GETHOTTRACKING)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6916
	arg = SPI_GETHOTTRACKING;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6917
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6918
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6919
#ifdef SPI_GETTOOLTIPANIMATION
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6920
    } else if (aNumberOrSymbol == @symbol(SPI_GETTOOLTIPANIMATION)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6921
	arg = SPI_GETTOOLTIPANIMATION;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6922
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6923
#endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6924
#ifdef SPI_GETWORKAREA
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6925
    } else if (aNumberOrSymbol == @symbol(SPI_GETWORKAREA)) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6926
	arg = SPI_GETWORKAREA;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6927
	isRect = 1;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6928
#endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6929
#ifdef SPI_GETNONCLIENTMETRICS
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6930
    } else if (aNumberOrSymbol == @symbol(SPI_GETNONCLIENTMETRICS)) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6931
	arg = SPI_GETNONCLIENTMETRICS;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6932
	rslt.nc.cbSize = sizeof ( rslt.nc ) ;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6933
	isNonClientInfo = 1;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6934
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6935
    } else {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6936
	RETURN (nil);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6937
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6938
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6939
    param = 0;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6940
    pRslt = (void *)&rslt;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6941
    if (isString) {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6942
	param = sizeof(rslt);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6943
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6944
    retVal = SystemParametersInfo(arg, param, pRslt, 0);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6945
    if (! retVal) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6946
	RETURN (nil);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6947
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6948
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6949
    if (isBool) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6950
	RETURN (info ? true : false);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6951
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6952
    if (isString) {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6953
	RETURN (__MKSTRING(rslt.buffer));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6954
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6955
    if (isRect) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6956
	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
  6957
			__MKSMALLINT(rslt.rect.left),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6958
			__MKSMALLINT(rslt.rect.top),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6959
			__MKSMALLINT(rslt.rect.right),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6960
			__MKSMALLINT(rslt.rect.bottom)) );
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6961
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6962
    if (isNonClientInfo) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6963
	menuFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfMenuFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6964
	statusFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfStatusFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6965
	messageFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfMessageFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6966
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6967
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6968
   out: ;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6969
%}.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6970
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6971
    menuFontInfoArray notNil ifTrue:[
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6972
	menuFont := self fontDescriptionFromLogicalFontInfoArray:menuFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6973
	statusFont := self fontDescriptionFromLogicalFontInfoArray:statusFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6974
	messageFont := self fontDescriptionFromLogicalFontInfoArray:messageFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6975
	^ (Dictionary new)
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6976
	    at:#menuFont put:menuFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6977
	    at:#statusFont put:statusFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6978
	    at:#messageFont put:messageFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6979
	    yourself.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6980
    ].
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6981
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6982
    ^ nil
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6983
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6984
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6985
     Screen current getSystemParametersInfo:#SPI_GETDESKWALLPAPER
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6986
     Screen current getSystemParametersInfo:#SPI_GETDROPSHADOW
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6987
     Screen current getSystemParametersInfo:#SPI_GETFLATMENU
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6988
     Screen current getSystemParametersInfo:#SPI_GETWHEELSCROLLLINES
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6989
     Screen current getSystemParametersInfo:#SPI_GETHOTTRACKING
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6990
     Screen current getSystemParametersInfo:#SPI_GETTOOLTIPANIMATION
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6991
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6992
     Screen current getSystemParametersInfo:#SPI_GETWORKAREA
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6993
     Screen current getSystemParametersInfo:#SPI_GETNONCLIENTMETRICS
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6994
    "
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6995
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6996
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6997
ignoreButtonPressOnActivate:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6998
    "set/clear the ignoreButtonPressOnActivate behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6999
     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
  7000
     and not passed to the window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7001
     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
  7002
     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
  7003
     activation.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7004
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7005
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7006
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7007
    OBJ rslt = __ignoreButtonPressOnActivate ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7008
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7009
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7010
       __ignoreButtonPressOnActivate = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7011
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7012
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7013
	   __ignoreButtonPressOnActivate = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7014
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7015
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7016
    RETURN (rslt);
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
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7019
     WinWorkstation ignoreButtonPressOnActivate:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7020
     WinWorkstation ignoreButtonPressOnActivate:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7021
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7022
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7023
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7024
monitorInfoFor:aMonitorId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7025
    "given a monitor handle (as returned by monitorHandleForXXX), return its info"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7026
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7027
    |screenL screenT screenR screenB screenW screenH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7028
     workL workT workR workB workW workH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7029
     isPrimary mName|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7030
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7031
    if (__isExternalAddress(aMonitorId)) {
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
  7032
	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
  7033
	MONITORINFOEX info;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7034
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7035
	info.cbSize = sizeof(MONITORINFOEX);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7036
#if 0
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  7037
	/* the following is only needed when we want
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  7038
	 * to support very old NT/W95/W98 systems; we don't !
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  7039
	 */
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7040
	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
  7041
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7042
	if (P_GetMonitorInfo == 0) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7043
	    HINSTANCE hUser = LoadLibrary("user32.dll");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7044
	    // 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
  7045
	    if (hUser) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7046
		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
  7047
				    GetProcAddress(hUser, "GetMonitorInfo");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7048
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7049
	}
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
  7050
	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
  7051
	if ((*P_GetMonitorInfo)(hMonitor, &info))
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7052
#else
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
  7053
	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
  7054
#endif
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7055
	{
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7056
	    // 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
  7057
	    screenL = __MKSMALLINT(info.rcMonitor.left);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7058
	    screenT = __MKSMALLINT(info.rcMonitor.top);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7059
	    screenR = __MKSMALLINT(info.rcMonitor.right);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7060
	    screenB = __MKSMALLINT(info.rcMonitor.bottom);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7061
	    workL = __MKSMALLINT(info.rcWork.left);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7062
	    workT = __MKSMALLINT(info.rcWork.top);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7063
	    workR = __MKSMALLINT(info.rcWork.right);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7064
	    workB = __MKSMALLINT(info.rcWork.bottom);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7065
	    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
  7066
	    info.szDevice[31] = '\0';
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7067
	    mName = __MKSTRING(info.szDevice);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7068
	}
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7069
    }
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7070
%}.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7071
    screenL isNil ifTrue:[ ^ nil ].
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
    ^ MonitorInfo new
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7074
	screenX:screenL screenY:screenT
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7075
	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
  7076
	workX:workL workY:workT
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7077
	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
  7078
	isPrimary:isPrimary
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7079
	name:mName
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7080
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7081
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7082
     Screen current monitorInfoFor:(Screen current monitorHandleForView:(Transcript topView id))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7083
     Screen current monitorInfoFor:(Screen current monitorHandleForPoint:(0@0))
5549
fd4fc69df52d fixed: #monitorHandleForPoint:
Claus Gittinger <cg@exept.de>
parents: 5546
diff changeset
  7084
     Screen current monitorInfoFor:(Screen current monitorHandleForPoint:(Display pointFromUser))
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7085
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7086
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7087
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7088
primGetSystemColor:aKey
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7089
    "retrieve a windows system color.
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7090
     The styleSheet/View classes may use this to setup default colors"
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7091
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7092
    |red green blue|
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7093
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7094
%{
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7095
    int p;
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7096
    int __bgr;
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7097
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7098
    if (aKey == @symbol(COLOR_WINDOW)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7099
      p = COLOR_WINDOW;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7100
    } else if (aKey == @symbol(COLOR_WINDOWTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7101
      p = COLOR_WINDOWTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7102
    } else if (aKey == @symbol(COLOR_MENU)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7103
      p = COLOR_MENU;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7104
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7105
      p = COLOR_MENUTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7106
    } else if (aKey == @symbol(COLOR_BTNFACE)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7107
      p = COLOR_BTNFACE;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7108
    } else if (aKey == @symbol(COLOR_BTNSHADOW)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7109
      p = COLOR_BTNSHADOW;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7110
    } else if (aKey == @symbol(COLOR_BTNTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7111
      p = COLOR_BTNTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7112
    } else if (aKey == @symbol(COLOR_GRAYTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7113
      p = COLOR_GRAYTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7114
    } else if (aKey == @symbol(COLOR_HIGHLIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7115
      p = COLOR_HIGHLIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7116
    } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7117
      p = COLOR_HIGHLIGHTTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7118
    } else if (aKey == @symbol(COLOR_MENU)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7119
      p = COLOR_MENU;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7120
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7121
      p = COLOR_MENUTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7122
    } else if (aKey == @symbol(COLOR_SCROLLBAR)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7123
      p = COLOR_SCROLLBAR;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7124
#ifdef COLOR_SHADOW
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7125
    } else if (aKey == @symbol(COLOR_SHADOW)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7126
      p = COLOR_SHADOW;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7127
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7128
#ifdef COLOR_BACKGROUND
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7129
    } else if (aKey == @symbol(COLOR_BACKGROUND)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7130
      p = COLOR_BACKGROUND;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7131
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7132
#ifdef COLOR_ACTIVECAPTION
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7133
    } else if (aKey == @symbol(COLOR_ACTIVECAPTION)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7134
      p = COLOR_ACTIVECAPTION;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7135
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7136
#ifdef COLOR_INACTIVECAPTION
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7137
    } else if (aKey == @symbol(COLOR_INACTIVECAPTION)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7138
      p = COLOR_INACTIVECAPTION;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7139
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7140
#ifdef COLOR_WINDOWFRAME
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7141
    } else if (aKey == @symbol(COLOR_WINDOWFRAME)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7142
      p = COLOR_WINDOWFRAME;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7143
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7144
#ifdef COLOR_CAPTIONTEXT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7145
    } else if (aKey == @symbol(COLOR_CAPTIONTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7146
      p = COLOR_CAPTIONTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7147
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7148
#ifdef COLOR_ACTIVEBORDER
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7149
    } else if (aKey == @symbol(COLOR_ACTIVEBORDER)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7150
      p = COLOR_ACTIVEBORDER;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7151
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7152
#ifdef COLOR_INACTIVEBORDER
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7153
    } else if (aKey == @symbol(COLOR_INACTIVEBORDER)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7154
      p = COLOR_INACTIVEBORDER;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7155
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7156
#ifdef COLOR_APPWORKSPACE
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7157
    } else if (aKey == @symbol(COLOR_APPWORKSPACE)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7158
      p = COLOR_APPWORKSPACE;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7159
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7160
#ifdef COLOR_INACTIVECAPTIONTEXT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7161
    } else if (aKey == @symbol(COLOR_INACTIVECAPTIONTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7162
      p = COLOR_INACTIVECAPTIONTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7163
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7164
#ifdef COLOR_BTNHIGHLIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7165
    } else if (aKey == @symbol(COLOR_BTNHIGHLIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7166
      p = COLOR_BTNHIGHLIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7167
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7168
#ifdef COLOR_3DDKSHADOW
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7169
    } else if (aKey == @symbol(COLOR_3DDKSHADOW)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7170
      p = COLOR_3DDKSHADOW;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7171
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7172
#ifdef COLOR_3DLIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7173
    } else if (aKey == @symbol(COLOR_3DLIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7174
      p = COLOR_3DLIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7175
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7176
#ifdef COLOR_INFOTEXT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7177
    } else if (aKey == @symbol(COLOR_INFOTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7178
      p = COLOR_INFOTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7179
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7180
#ifdef COLOR_INFOBK
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7181
    } else if (aKey == @symbol(COLOR_INFOBK)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7182
      p = COLOR_INFOBK;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7183
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7184
#ifdef COLOR_HOTLIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7185
    } else if (aKey == @symbol(COLOR_HOTLIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7186
      p = COLOR_HOTLIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7187
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7188
#ifdef COLOR_GRADIENTACTIVECAPTION
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7189
    } else if (aKey == @symbol(COLOR_GRADIENTACTIVECAPTION)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7190
      p = COLOR_GRADIENTACTIVECAPTION;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7191
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7192
#ifdef COLOR_GRADIENTINACTIVECAPTION
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7193
    } else if (aKey == @symbol(COLOR_GRADIENTINACTIVECAPTION)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7194
      p = COLOR_GRADIENTINACTIVECAPTION;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7195
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7196
#ifdef COLOR_DESKTOP
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7197
    } else if (aKey == @symbol(COLOR_DESKTOP)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7198
      p = COLOR_DESKTOP;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7199
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7200
#ifdef COLOR_3DFACE
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7201
    } else if (aKey == @symbol(COLOR_3DFACE)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7202
      p = COLOR_3DFACE;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7203
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7204
#ifdef COLOR_3DSHADOW
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7205
    } else if (aKey == @symbol(COLOR_3DSHADOW)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7206
      p = COLOR_3DSHADOW;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7207
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7208
#ifdef COLOR_3DHIGHLIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7209
    } else if (aKey == @symbol(COLOR_3DHIGHLIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7210
      p = COLOR_3DHIGHLIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7211
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7212
#ifdef COLOR_3DHILIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7213
    } else if (aKey == @symbol(COLOR_3DHILIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7214
      p = COLOR_3DHILIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7215
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7216
#ifdef COLOR_BTNHILIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7217
    } else if (aKey == @symbol(COLOR_BTNHILIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7218
      p = COLOR_BTNHILIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7219
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7220
    } else {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7221
      goto getOutOfHere;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7222
    }
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7223
    __bgr = GetSysColor(p);
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
    /* win uses BGR order */
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7226
    red = __MKSMALLINT(__bgr & 0xFF);
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7227
    green = __MKSMALLINT((__bgr >> 8) & 0xFF);
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7228
    blue = __MKSMALLINT((__bgr >> 16) & 0xFF);
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7229
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7230
getOutOfHere: ;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7231
%}.
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7232
    red isNil ifTrue:[ ^ nil ].
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7233
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7234
    ^ Color
7452
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
  7235
	redByte:red
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
  7236
	greenByte:green
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
  7237
	blueByte:blue
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7238
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7239
    "
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7240
     Display primGetSystemColor:#COLOR_WINDOW
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7241
     Display primGetSystemColor:#COLOR_HIGHLIGHT
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7242
    "
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7243
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7244
    "Modified: / 30-10-2007 / 15:06:02 / cg"
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
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7247
primViewIdFromPoint:aPoint in:windowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7248
    "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
  7249
     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
  7250
     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
  7251
     - 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
  7252
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7253
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7254
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7255
    OBJ xp, yp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7256
    int xpos, ypos;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7257
    HWND child_ret;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7258
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7259
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7260
     && __isExternalAddress(windowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7261
     && __isPoint(aPoint))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7262
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7263
	xp = _point_X(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7264
	yp = _point_Y(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7265
	if (__bothSmallInteger(xp, yp))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7266
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7267
	    POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7268
	    HWND hWnd = _HWNDVal(windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7269
	    p.x = __intVal(xp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7270
	    p.y = __intVal(yp);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7271
	    ScreenToClient(hWnd, &p);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7272
	    child_ret = ChildWindowFromPointEx(hWnd,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7273
	    /*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
  7274
	    if ((child_ret) && (child_ret != hWnd))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7275
	    {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7276
		RETURN ( __MKEXTERNALADDRESS(child_ret) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7277
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7278
	    RETURN ( nil );
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
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7281
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7282
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7283
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7284
prim_getWindowRect:hWnd
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7285
    |l r t b|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7286
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7287
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7288
    if (__isExternalAddress(hWnd) || __isExternalBytesLike(hWnd)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7289
	HANDLE _hwnd = __externalAddressVal(hWnd);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7290
	RECT rect;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7291
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7292
	if (GetWindowRect(_hwnd, &rect)) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7293
	    l = __MKSMALLINT(rect.left);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7294
	    r = __MKSMALLINT(rect.right);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7295
	    t = __MKSMALLINT(rect.top);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7296
	    b = __MKSMALLINT(rect.bottom);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7297
	}
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7298
    }
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7299
%}.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7300
    l isNil ifTrue:[
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7301
	self primitiveFailed.
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7302
    ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7303
    ^ l@t corner:r@b
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
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7306
protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7307
    "return the displays protocol version.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7308
     For Windows, a dummy number is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7309
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7310
    ^ '1'
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
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7313
     Display protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7314
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7315
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7316
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7317
rightButtonIsLowerWindow:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7318
    "set/clear the rightButtonIsLowerWindow behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7319
     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
  7320
     window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7321
     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
  7322
     and not provided by the standard windows applications.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7323
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7324
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7325
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7326
    OBJ rslt = __rightButtonIsLowerWindow ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7327
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7328
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7329
       __rightButtonIsLowerWindow = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7330
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7331
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7332
	   __rightButtonIsLowerWindow = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7333
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7334
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7335
    RETURN (rslt);
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
    "
5440
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7338
     Display rightButtonIsLowerWindow:true
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7339
     Display rightButtonIsLowerWindow:false
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7340
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7341
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7342
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7343
serverVendor
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7344
    "return the server vendor string.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7345
     For Windows, a dummy name is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7346
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7347
    ^ 'microsoft'
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
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7350
     Display serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7351
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7352
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7353
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7354
shiftMask
3261
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7355
    "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
  7356
     Obsolete"
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7357
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7358
%{  /* NOCONTEXT */
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7359
    RETURN (__MKSMALLINT(ShiftMask));
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7360
%}
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7361
!
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
shiftModifierMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7364
    "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
  7365
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7366
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7367
    RETURN (__MKSMALLINT(ShiftMask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7368
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7369
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7370
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7371
shiftedLeftButtonIsLowerWindow:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7372
    "set/clear the shiftedLeftButtonIsLowerWindow behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7373
     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
  7374
     window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7375
     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
  7376
     and not provided by the standard windows applications.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7377
     Notice, this duplicates the rightButtonIsLowerWindow behavior,
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7378
     but is useful with single-button mice.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7379
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7380
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7381
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7382
    OBJ rslt = __shiftedLeftButtonIsLowerWindow ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7383
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7384
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7385
       __shiftedLeftButtonIsLowerWindow = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7386
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7387
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7388
	   __shiftedLeftButtonIsLowerWindow = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7389
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7390
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7391
    RETURN (rslt);
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
    "
5440
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7394
     Display shiftedLeftButtonIsLowerWindow:true
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7395
     Display shiftedLeftButtonIsLowerWindow:false
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7396
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7397
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7398
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7399
supportedSystemColorKeys
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7400
    "return a collection of supported systemColor keys"
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7401
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7402
    ^#(
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7403
	COLOR_WINDOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7404
	COLOR_WINDOWTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7405
	COLOR_MENU
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7406
	COLOR_MENUTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7407
	COLOR_BTNFACE
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7408
	COLOR_BTNSHADOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7409
	COLOR_BTNTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7410
	COLOR_GRAYTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7411
	COLOR_HIGHLIGHT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7412
	COLOR_HIGHLIGHTTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7413
	COLOR_MENU
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7414
	COLOR_MENUTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7415
	COLOR_SCROLLBAR
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7416
	COLOR_SHADOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7417
    )
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7418
!
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7419
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7420
translatePoint:aPoint from:windowId1 to:windowId2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7421
    "given a point in window1, return the coordinate in window2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7422
     This expects a device coordinate (relative to the first views origin)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7423
     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
  7424
     - use to xlate points from a window to rootwindow"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7425
6004
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7426
    |x1 y1 x2 y2 ret|
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7427
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7428
    x1 := x2 := aPoint x truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7429
    y1 := y2 := aPoint y truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7430
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7431
%{
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7432
    HWND w1, w2;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7433
    POINT point;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7434
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7435
    if (__isExternalAddress(windowId1)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7436
     && __isExternalAddress(windowId2)
2279
30a35be06995 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2276
diff changeset
  7437
     && __bothSmallInteger(x1, y1)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7438
	w1 = _HWNDVal(windowId1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7439
	w2 = _HWNDVal(windowId2);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7440
	point.x = __intVal(x1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7441
	point.y = __intVal(y1);
6004
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7442
	CPRINTF(("TransPoint %x %d/%d ->", w1, point.x, point.y));
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7443
	if (ClientToScreen(w1, &point) == FALSE) {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7444
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7445
	}
6004
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7446
	if (ScreenToClient(w2, &point) == FALSE) {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7447
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7448
	}
6004
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7449
	CPRINTF((" %x %d/%d\n", w2, point.x, point.y));
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7450
	ret = __MKPOINT_INT(point.x, point.y);
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7451
    }
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7452
%}.
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7453
    ^ ret
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7454
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7455
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7456
vendorRelease
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7457
    "return the display-servers vendor release
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7458
     - should normally not be of any interest,
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7459
     but may be usefule for special cases.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7460
     (to avoid bugs in certain implementations / releases)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7461
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7462
    ^ 1
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
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7465
     Display vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7466
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7467
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7468
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7469
viewIdFromPoint:aPoint in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7470
    "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
  7471
     hit by this coordinate. Return nil if no view was hit.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7472
     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
  7473
     - 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
  7474
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7475
    windowId notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7476
	aPoint isPoint ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7477
	    "/(aPoint x > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7478
	    "/(aPoint y > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7479
	    "/aPoint printString errorPrintCR.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7480
	    ^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7481
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7482
    ].
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
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7485
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7486
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7487
whitepixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7488
    "return the colornumber of white"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7489
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7490
    ^ whitepixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7491
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7492
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7493
!WinWorkstation methodsFor:'accessing display capabilities'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7494
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7495
captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7496
    "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
  7497
     standard topWindows."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7498
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7499
    ^ self getSystemMetrics:#SM_CYCAPTION
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7500
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7501
    "Modified: / 08-09-2006 / 15:39:24 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7502
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7503
5672
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7504
getDeviceCaps:hdc index:index
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7505
    <apicall: int "GetDeviceCaps" (handle int) module: "gdi32.dll" >
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7506
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7507
    "Created: / 24-12-2010 / 11:14:59 / cg"
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7508
!
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7509
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7510
iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7511
    "Get the preferred/supported icon sizes."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7512
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7513
    |d w h|
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7514
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7515
    w := self getSystemMetrics:#SM_CXICON.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7516
    h := self getSystemMetrics:#SM_CYICON.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7517
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7518
    d := IdentityDictionary new.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7519
    d at:#minWidth put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7520
    d at:#maxWidth put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7521
    d at:#widthStep put:1.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7522
    d at:#minHeight put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7523
    d at:#maxHeight put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7524
    d at:#heightStep put:1.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7525
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7526
    ^ OrderedCollection with:d
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
    "
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7529
     Display iconSizes
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7530
    "
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7531
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7532
    "Modified: / 08-09-2006 / 15:40:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7533
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7534
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7535
monitorBoundsAt:aPoint
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7536
    "answer the bounds of the monitor the point is contained in"
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7537
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7538
    |monitorHandle monitorInfo|
5607
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7539
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7540
    self numberOfMonitors > 1 ifTrue:[
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7541
	"/ ******* MULTI SCREEN ******
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7542
	monitorHandle := self monitorHandleForPoint:aPoint.
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7543
	monitorHandle notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7544
	    monitorInfo := self monitorInfoFor:monitorHandle.
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7545
	    monitorInfo notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7546
		^ monitorInfo bounds
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7547
	    ].
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7548
	].
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7549
    ].
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7550
    ^ super monitorBoundsAt:aPoint
5621
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7551
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7552
    "
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7553
     Display monitorBoundsAt:100@100
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7554
     Display monitorBoundsAt:2000@100
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7555
     Display monitorBoundsAt:-200@100
5607
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7556
    "
5621
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7557
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7558
    "Modified: / 22-10-2010 / 10:55:59 / cg"
5607
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7559
!
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7560
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7561
numberOfMonitors
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7562
    ^ self getSystemMetrics:#SM_CMONITORS
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7563
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7564
    "
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7565
     Display numberOfMonitors
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7566
    "
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7567
!
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7568
5640
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7569
pointIsVisible:aPoint
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7570
    "is the point visible?"
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7571
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7572
    ^ (self monitorHandleForPoint:aPoint) notNil
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
5637
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7575
pointsAreOnSameMonitor:point1 and:point2
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7576
    "are the two points on the same (multi-screen) monitors?"
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7577
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7578
    ^ (self monitorHandleForPoint:point1) = (self monitorHandleForPoint:point2)
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
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7581
preferredIconSize
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7582
    "Get the preferrered icon size.
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7583
     Here, workaround windows (bug?) which returns 32@32
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7584
     although, 20@20 is much nicer"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7585
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7586
    ^ 20@20
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
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7589
     Display preferredIconSize
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7590
    "
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7591
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7592
    "Modified: / 28.9.1998 / 13:49:54 / cg"
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
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7595
scrollsAsynchronous
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7596
    "return true, if this display asynchronously sends expose events after a
6028
7a9807630f4f class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  7597
     scroll operation. False otherwise. Asynchronous expose events are an X11
6020
24d09f0c1e6c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6008
diff changeset
  7598
     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
  7599
     However, the underlying WinWorkstation code simulates this behavior,
7a9807630f4f class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  7600
     so we return true here as well."
7a9807630f4f class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  7601
7a9807630f4f class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  7602
    ^ true.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7603
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7604
5866
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7605
smallestMonitorHeight
5867
f6b5ce37a2a5 comment/format in: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5866
diff changeset
  7606
    "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
  7607
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7608
    |info minH|
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
    minH := self usableHeight.
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7611
    self monitorHandles do:[:eachHandle |
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
  7612
	info := self monitorInfoFor:eachHandle.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
  7613
	info notNil ifTrue:[ minH := minH min: info workHeight ].
5866
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7614
    ].
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7615
    ^ minH
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
    "
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7618
     Display smallestMonitorHeight
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
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7621
    "Modified: / 22-10-2010 / 15:34:44 / cg"
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
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7624
supportedImageFormats
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7625
    "return an array with supported image formats; each array entry
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7626
     is another array, consisting of depth and bitsPerPixel values."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7627
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7628
    |info|
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 := IdentityDictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7631
    info at:#depth put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7632
    info at:#bitsPerPixel put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7633
    info at:#padding put:32.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7634
    ^ Array with:info
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7635
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7636
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7637
     Disply supportedImageFormats
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
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7640
    "Modified: / 10.9.1998 / 23:14:05 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7641
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7642
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7643
supportsDeepIcons
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7644
    "return true, if this device supports deepicons."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7645
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7646
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7647
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7648
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7649
supportsIconMasks
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7650
    "return true, if this device supports masked icons.
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7651
     For now, return false since somehow icons are inverted
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7652
     if we use masks (and I dont know yet why)."
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7653
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7654
    ^ false
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
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7657
     Display supportsIconMasks
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7658
    "
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7659
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7660
    "Modified: / 28.4.1999 / 19:59:17 / cg"
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7663
supportsIconViews
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7664
    "return true, if this device supports views as icons."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7665
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7666
    ^ false "/ true
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7667
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7668
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7669
     Display supportsIconViews
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7670
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7671
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7672
    "Modified: 10.6.1996 / 20:11:48 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7673
    "Created: 10.6.1996 / 21:08:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7674
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7675
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7676
supportsMaskedDrawingWith:aForm
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7677
    "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
  7678
     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
  7679
7472
2af1c55ce4b6 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7452
diff changeset
  7680
    ^ self supportsAnyViewBackgroundPixmaps
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7681
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7682
    "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
  7683
    "Modified: / 4.5.1999 / 12:58:31 / cg"
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  7684
!
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  7685
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7686
supportsViewBackgroundPixmap:aForm
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7687
    "return true, if the device allows the given pixmap as
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7688
     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
  7689
     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
  7690
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  7691
    ^ true
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7692
!
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7693
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7694
supportsWindowBorder:aNumber
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7695
    "return true, if this device supports bordered windows.
3109
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7696
     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
  7697
     to be supported by the device.
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7698
     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
  7699
     future. (Windows only supports borders 1 and noBorder)"
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7700
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7701
    ^ (aNumber ? 0) <= 1
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7702
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7703
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7704
     Display supportsWindowBorder:1
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7705
    "
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7706
!
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7707
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7708
usableExtent
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7709
    "return the usable extent of the display (in pixels).
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7710
     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
  7711
     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
  7712
     or bigger, in case of multi-screen systems"
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7713
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7714
    |wSingle hSingle w h dx dy|
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7715
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7716
    w := wSingle := self getSystemMetrics:#SM_CXFULLSCREEN.
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7717
    h := hSingle := self getSystemMetrics:#SM_CYFULLSCREEN.
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7718
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7719
    (self numberOfMonitors) > 1 ifTrue:[
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7720
	w := self getSystemMetrics:#SM_CXVIRTUALSCREEN.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7721
	h := self getSystemMetrics:#SM_CYVIRTUALSCREEN.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7722
	(w isNil or:[h isNil]) ifTrue:[
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7723
	    "/ not supported under win95 and win-nt4 - fallback to real extent
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7724
	    w := wSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7725
	    h := hSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7726
	] ifFalse:[
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7727
	    dx := (self getSystemMetrics:#SM_CXSCREEN) - wSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7728
	    dy := (self getSystemMetrics:#SM_CYSCREEN) - hSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7729
	    w := w - dx.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7730
	    h := h - dy - 8.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7731
	].
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7732
    ].
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7733
    ^ w @ h.
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
    "
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7736
     Display usableExtent
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7737
     Display getSystemMetrics:#SM_CYVIRTUALSCREEN
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7738
     Display getSystemMetrics:#SM_CYFULLSCREEN
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7739
     Display getSystemMetrics:#SM_CYSCREEN
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7740
     Display getSystemMetrics:#SM_CMONITORS
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7741
    "
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7742
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7743
    "Modified: / 08-09-2006 / 18:19:22 / cg"
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7744
!
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7745
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7746
usableHeightAt:aPoint
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7747
    "returns the usable height of the display (in pixels) at a given point
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7748
     Normally, the same as height, but may be smaller, in
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7749
     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
  7750
     On multi-display systems with different sized screens, this should care for
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7751
     which display is at the given x-position"
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7752
5943
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7753
    |info fullHeight usableHeight delta|
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7754
5630
a690d4635014 changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5621
diff changeset
  7755
    true "(self numberOfMonitors) > 1" ifTrue:[
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7756
	"/ ******* MULTI SCREEN ******
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7757
	info := self monitorInfoFor:(self monitorHandleForPoint:aPoint).
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7758
	info notNil ifTrue:[
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7759
	    ^ info workHeight
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7760
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7761
	"/ only works with single screen..
6565
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  7762
"/            fullHeight := self getSystemMetrics:#SM_CYVIRTUALSCREEN.
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  7763
"/            usableHeight := self getSystemMetrics:#SM_CYFULLSCREEN.  "/ without any start-menu bar
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  7764
"/            delta := fullHeight - usableHeight.
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  7765
"/            ^ info workHeight - delta
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7766
	].
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7767
    ].
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7768
    ^ self usableHeight
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7769
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7770
    "
5943
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7771
     Display numberOfMonitors
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7772
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7773
     Display usableHeight
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7774
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  7775
     Display usableHeightAt:100@100
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  7776
     Display usableHeightAt:2000@100
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7777
     Display usableHeightAt:-200@100
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7778
    "
5621
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7779
5943
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7780
    "Modified (comment): / 27-10-2012 / 13:34:32 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7781
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7782
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7783
!WinWorkstation methodsFor:'bitmap/window creation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7784
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7785
addMenuItemWithLabel:aString toWindowID:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7786
    "not yet"
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7787
%{
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7788
#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
  7789
    if (__isExternalAddress(aWindowId)) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7790
	HWND hWin = _HWNDVal(aWindowId);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7791
	HMENU hMenu;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7792
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7793
	hMenu = GetMenu(hWin);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7794
	if (hMenu) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7795
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7796
	}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7797
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7798
#endif
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7799
%}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7800
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7801
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7802
createBitmapFromArray:anArray width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7803
    |bitmapId|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7804
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7805
    bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7806
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7807
    bitmapId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7808
	'WINWORKSTATION: cannot create bitmap' errorPrintCR.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7809
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7810
    ^ bitmapId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7811
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7812
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7813
createBitmapWidth:w height:h
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7814
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7815
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7816
    HANDLE newBitmapHandle;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7817
    int b_width, b_height;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7818
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7819
    if (__bothSmallInteger(w, h)) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7820
	b_width = __intVal(w);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7821
	b_height = __intVal(h);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7822
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7823
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7824
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7825
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7826
	    __cnt_bitmap++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7827
	    RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle, __cnt_bitmap));
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7828
#endif
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7829
	    RETURN ( __MKOBJ(newBitmapHandle));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7830
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7831
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7832
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7833
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7834
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7835
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7836
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7837
createPixmapWidth:w height:h depth:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7838
    "allocate a pixmap on the Xserver, the contents is undefined
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7839
     (i.e. random). Return a bitmap id or nil"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7840
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7841
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7842
    HANDLE newBitmapHandle;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7843
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7844
    /*console_printf("CreateBitmap Color\n");*/
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7845
    if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7846
	if (__intVal(d) == 1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7847
	    newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7848
	} else {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7849
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7850
	    if (__intVal(d) != __depth) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7851
		console_printf("invalid depth\n");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7852
		RETURN (nil);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7853
	    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7854
#endif
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7855
	    newBitmapHandle = CreateCompatibleBitmap(__rootDC, __intVal(w), __intVal(h) );
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7856
	}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7857
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7858
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7859
#ifdef COUNT_BMP_RESOURCES
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7860
	    __cnt_bitmap++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7861
	    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
  7862
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7863
	    RETURN ( __MKOBJ(newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7864
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7865
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
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
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7868
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7869
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7870
1467
9629ce710c53 added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  7871
createWindowFor:aView type:typeSymbol
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7872
		 origin:origin
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7873
		 extent:extent
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7874
		 minExtent:minExt
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7875
		 maxExtent:maxExt
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7876
		 borderWidth:bWidth
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7877
		 subViewOf:wsuperView
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7878
		 style:wStyle
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7879
		 inputOnly:winputOnly
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7880
		 label:wlabel
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7881
		 owner:wowner
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7882
		 icon:wicon
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7883
		 iconMask:wiconMaskArg
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7884
		 iconView:wiconView
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7885
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7886
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7887
    |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight
4326
2c828f8b5173 fixed iconMask
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  7888
     wsuperViewId wiconId wiconMask invertedWiconMask wiconMaskId windowId
2c828f8b5173 fixed iconMask
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  7889
     weventMask wiconWidth wiconHeight windowType windowClass moreArgs|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7890
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7891
    "/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7892
    "/  preferredVisual preferredDepth  viewGravity wcursorId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7893
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7894
    displayId isNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7895
	self primitiveFailed.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7896
	^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7897
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7898
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7899
    origin notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7900
	xpos := origin x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7901
	ypos := origin y.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7902
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7903
	xpos := ypos := 0.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7904
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7905
    extent notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7906
	wwidth := extent x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7907
	wheight := extent y.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7908
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7909
	wwidth := 100.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7910
	wheight := 40.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7911
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7912
    minExt notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7913
	minWidth := minExt x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7914
	minHeight := minExt y
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7915
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7916
	minWidth := 1.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7917
	minHeight := 1.
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7918
    ].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7919
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7920
    maxExt notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7921
	maxWidth := maxExt x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7922
	maxHeight := maxExt y
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7923
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7924
	"/ this is not really a good idea
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7925
	"/ maxWidth := width.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7926
	"/ maxHeight := height.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7927
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7928
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7929
    wsuperView notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7930
	wsuperViewId := wsuperView id
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7931
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7932
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7933
    wicon notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7934
	wiconId := wicon id.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7935
	wiconHeight := wicon height.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7936
	wiconWidth  := wicon width.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7937
	wiconMask := wiconMaskArg.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7938
	wiconMask isNil ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7939
	    wiconMask := wicon mask.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7940
	].
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7941
	wiconMask notNil ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7942
	    "/ WIN32's mask has zeros for opaque pixels
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7943
	    invertedWiconMask := wiconMask copy.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7944
	    invertedWiconMask bits invert.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7945
	    invertedWiconMask := invertedWiconMask onDevice:self.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7946
	    wiconMaskId := invertedWiconMask id
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7947
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7948
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7949
"/    wiconView notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7950
"/        wiconViewId := wiconView id
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7951
"/    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7952
    weventMask := aView eventMask.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7953
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  7954
    NativeWidgets ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7955
	windowType := aView nativeWindowType.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7956
	windowType notNil ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7957
	    "/ must be a symbol and is used
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7958
	    "/ as a key into the nativeClass translation map.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7959
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7960
	    windowClass := NativeWidgetClassTable at:windowType ifAbsent:windowType.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7961
	    self class debugNative ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7962
		'WinWorkstation [info]: windowType: ' infoPrint. windowType infoPrint.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7963
		' windowClass: ' infoPrint. windowClass infoPrintCR.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7964
	    ].
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7965
	].
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7966
    ].
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7967
    aView isMDIClientView ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7968
	windowClass := 'mdiclient'.
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7969
    ].
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7970
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7971
    windowClass notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7972
	aView beNativeWidget.
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7973
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7974
	aView beNonNativeWidget.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7975
    ].
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7976
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7977
    moreArgs := Array new:20.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7978
    moreArgs at:1 put:xpos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7979
    moreArgs at:2 put:ypos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7980
    moreArgs at:3 put:wwidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7981
    moreArgs at:4 put:wheight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7982
    moreArgs at:5 put:minWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7983
    moreArgs at:6 put:minHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7984
    moreArgs at:7 put:maxWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7985
    moreArgs at:8 put:maxHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7986
    moreArgs at:9 put:wsuperViewId.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7987
    moreArgs at:10 put:nil. "/ wcursorId.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7988
    moreArgs at:11 put:wiconId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7989
    moreArgs at:12 put:wiconMaskId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7990
    moreArgs at:13 put:wiconWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7991
    moreArgs at:14 put:wiconHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7992
    moreArgs at:15 put:windowType.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7993
    moreArgs at:16 put:windowClass.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7994
    moreArgs at:17 put:weventMask.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7995
    moreArgs at:18 put:(aView className asString).
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7996
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7997
    [
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7998
      windowId := self
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7999
		  primCreateWindowFor:aView
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8000
		  type:typeSymbol
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8001
		  borderWidth:bWidth
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8002
		  subViewOf:wsuperView
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8003
		  style:wStyle
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8004
		  inputOnly:winputOnly
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8005
		  label:wlabel
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8006
		  owner:wowner
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8007
		  icon:wicon
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8008
		  iconMask:wiconMask
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8009
		  moreArgs:moreArgs.
7452
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
  8010
      aView graphicsContext setId:windowId.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8011
    ] valueUninterruptably.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8012
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  8013
    windowId notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8014
	self addKnownView:aView withId:windowId
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  8015
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8016
    ^ 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
  8017
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
  8018
    "Modified: / 28-01-2012 / 10:20:30 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8019
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8020
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8021
destroyGC:aGCId
4478
fb57ec7d7cc4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
  8022
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8023
    if (__isExternalAddress(aGCId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8024
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8025
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8026
	if (gcData == NULL) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8027
	    console_fprintf(stderr, "WinWorkstation [warning]: trying to destroy GC twice\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8028
	    RETURN(self);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8029
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8030
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8031
#ifdef COUNT_RESOURCES
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8032
	 __cnt_gcData--;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8033
	RESPRINTF(("DestroyGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8034
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8035
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8036
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8037
	if (lastGcData == gcData) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8038
	    _releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8039
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8040
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8041
	__ExternalAddressInstPtr(aGCId)->e_address = NULL;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  8042
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  8043
	freeGcData(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8044
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8045
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8046
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8047
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8048
destroyPixmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8049
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8050
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8051
    if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8052
	HANDLE bitmapHandle = _HANDLEVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8053
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8054
	if (bitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8055
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8056
	    __cnt_bitmap--;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8057
	    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
  8058
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8059
	    _DeleteObject(bitmapHandle, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8060
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8061
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8062
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8063
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8064
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8065
destroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8066
    self primDestroyView:aView withId:aWindowId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8067
    self removeKnownView:aView withId:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8068
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8069
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8070
gcFor:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8071
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8072
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8073
    HWND hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8074
    struct gcData *gcData;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8075
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8076
    if (__isExternalAddress(aDrawableId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8077
	hWnd = _HWNDVal(aDrawableId);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8078
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8079
	if (! hWnd) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8080
	    RETURN (nil);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8081
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8082
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8083
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8084
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8085
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8086
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8087
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8088
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8089
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8090
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8091
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8092
	gcData->hWnd = hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8093
	gcData->_hDC = 0;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8094
	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
  8095
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8096
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8097
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8098
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8099
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8100
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8101
gcForBitmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8102
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8103
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8104
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8105
    if (__isExternalAddress(aDrawableId)) {  /* HBITMAP */
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8106
	struct gcData *gcData;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8107
	BITMAP bitmap;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8108
	HBITMAP hBitmap = _HBITMAPVAL(aDrawableId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8109
	HDC hDC;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8110
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8111
	if (! hBitmap) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8112
	    RETURN (nil);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8113
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8114
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8115
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8116
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8117
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8118
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8119
	if (GetObject(hBitmap, sizeof(bitmap), &bitmap)) {
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  8120
	    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
  8121
	} else {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  8122
	    DPRINTF(("noinfo returned for bitmap\n"));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8123
	    /* mhmh - can this happen ? */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8124
	    bitmap.bmBitsPixel = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8125
	}
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8126
	gcData->hBitmap = hBitmap;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8127
	gcData->bitmapColorBitCount = bitmap.bmBitsPixel;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8128
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8129
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8130
	__cnt_gcData++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8131
	RESPRINTF(("CreateGcData %d\n", __cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8132
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8133
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8134
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8135
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8136
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8137
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8138
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8139
gcForHDC: aDeviceContextHandle
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8140
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8141
%{  /* NOCONTEXT */
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8142
    HDC hDC;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8143
    struct gcData *gcData;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8144
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8145
    if (__isExternalAddressLike(aDeviceContextHandle)) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8146
	hDC = _HDCVal(aDeviceContextHandle);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8147
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8148
	if (! hDC) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8149
	    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8150
	}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8151
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8152
	gcData = newGcData();
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8153
	if (! gcData) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8154
	    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8155
	}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8156
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8157
#ifdef COUNT_RESOURCES
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8158
	__cnt_gcData++;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8159
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8160
#endif
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8161
	gcData->_hDC = hDC;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8162
	gcData->doNotCacheOrRelease = 1;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8163
	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
  8164
	RETURN ( __MKOBJ(gcData) );
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8165
    }
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8166
    RETURN (nil);
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
!
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8169
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8170
primCreateBitmapFromArray:anArray width:w height:h
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8171
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8172
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8173
    HBITMAP newBitmapHandle;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8174
    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
  8175
    int row, col;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8176
    unsigned char *cp, *bPits;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8177
    unsigned char *b_bits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8178
    int index;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8179
    OBJ num;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8180
    unsigned char *allocatedBits = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8181
    unsigned char fastBits[10000];
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8182
5546
8387e6a32b6d Use __isArrayLike() and __isByteArrayLike()
Stefan Vogel <sv@exept.de>
parents: 5545
diff changeset
  8183
    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
  8184
	b_width = __intVal(w);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8185
	b_height = __intVal(h);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8186
	bytesPerRowST = (b_width + 7) / 8;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8187
	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
  8188
	padding = bytesPerRowWN - bytesPerRowST;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8189
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8190
	if ((padding == 0) && (__isByteArrayLike(anArray))) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8191
	    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
  8192
	    cp = 0;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8193
	} else {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8194
	    int nBytes = b_height * bytesPerRowWN;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8195
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8196
	    if (nBytes < sizeof(fastBits)) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8197
		cp = b_bits = fastBits;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8198
	    } else {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8199
		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
  8200
		if (! cp) goto fail;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8201
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8202
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8203
	if (cp) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8204
	    if (__qIsArrayLike(anArray)) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8205
		OBJ *op;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8206
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8207
		index = 1;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8208
		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
  8209
		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
  8210
		    for (col = bytesPerRowST; col; col--) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8211
			num = *op++;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8212
			if (! __isSmallInteger(num))
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8213
			    goto fail;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8214
			*cp++ = __intVal(num);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8215
		    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8216
		    cp += padding;
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
	    } else if (__qIsByteArrayLike(anArray)) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8219
		unsigned char *pBits;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8220
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8221
		pBits = __ByteArrayInstPtr(anArray)->ba_element;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8222
		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
  8223
		    for (col = bytesPerRowST; col; col--) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8224
			*cp++ = ( *pBits++ /*^ 0xFF*/ );
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8225
		    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8226
		    cp += padding;
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
	    } else {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8229
		goto fail;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8230
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8231
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8232
	CPRINTF(("create bitmap ...\n"));
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
	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
  8235
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8236
	if (newBitmapHandle ) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8237
#ifdef COUNT_BMP_RESOURCES
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8238
	    __cnt_bitmap++;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8239
	    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
  8240
#endif
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  8241
	    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
  8242
	    if (allocatedBits) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8243
		free(allocatedBits);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8244
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8245
	    RETURN ( __MKEXTERNALADDRESS(newBitmapHandle));
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8246
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8247
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8248
fail: ;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8249
    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
  8250
    if (allocatedBits) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8251
	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
  8252
	free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8253
    }
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8254
    CPRINTF(("returning nil ...\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8255
    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8256
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8257
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8258
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8259
primCreateWindowFor:aView type:typeSymbol
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8260
	  borderWidth:bWidth subViewOf:wsuperView
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8261
	  style:wStyle inputOnly:winputOnly
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8262
	  label:wlabel owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8263
	  icon:wicon iconMask:wiconMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8264
	  moreArgs:moreArgs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8265
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8266
%{  /* STACK: 16000 */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8267
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8268
    WNDCLASS wc;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8269
    long bg, bd, bw;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  8270
    int winStyleBits, winEXStyleBits;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8271
    int w, h, x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8272
    int min_width, min_height;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8273
    int max_width, max_height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8274
    OBJ eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8275
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8276
    HANDLE parentHandle;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8277
    HWND newWindowHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8278
    OBJ xpos, ypos, wwidth, wheight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8279
    OBJ minWidth, minHeight, maxWidth, maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8280
    OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8281
    OBJ wiconWidth, wiconHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8282
    OBJ windowType, windowClass, windowId;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8283
    OBJ stClassName;
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8284
    int isTopWindow = 0, isNativeWindow = 0, isMDIChild = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8285
    localWindowInfo *lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8286
    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
  8287
    static int nextSequenceNr = 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8288
    unsigned char* cp;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8289
    HBITMAP        xBitMap, maskBitmap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8290
    HICON          xIcon = (HICON)0;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8291
    ICONINFO       iconInfo;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8292
    char *className;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8293
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8294
#   define MAX_LABEL_SIZE       256
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8295
#   define MAX_CLASSNAME_SIZE   256
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8296
    static wchar_t classNameBufferw[MAX_CLASSNAME_SIZE];
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8297
    static wchar_t windowNameBufferw[MAX_LABEL_SIZE];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8298
    unsigned char fastBits[10000];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8299
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8300
    xpos = __ArrayInstPtr(moreArgs)->a_element[0];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8301
    ypos = __ArrayInstPtr(moreArgs)->a_element[1];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8302
    wwidth = __ArrayInstPtr(moreArgs)->a_element[2];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8303
    wheight = __ArrayInstPtr(moreArgs)->a_element[3];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8304
    minWidth = __ArrayInstPtr(moreArgs)->a_element[4];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8305
    minHeight = __ArrayInstPtr(moreArgs)->a_element[5];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8306
    maxWidth = __ArrayInstPtr(moreArgs)->a_element[6];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8307
    maxHeight = __ArrayInstPtr(moreArgs)->a_element[7];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8308
    wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8309
    wcursorId = __ArrayInstPtr(moreArgs)->a_element[9];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8310
    wiconId = __ArrayInstPtr(moreArgs)->a_element[10];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8311
    wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8312
    wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8313
    wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8314
    windowType = __ArrayInstPtr(moreArgs)->a_element[14];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8315
    windowClass = __ArrayInstPtr(moreArgs)->a_element[15];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8316
    eventMask = __ArrayInstPtr(moreArgs)->a_element[16];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8317
    stClassName = __ArrayInstPtr(moreArgs)->a_element[17];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8318
    bg = WhitePixel;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8319
    bd = BlackPixel;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8320
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8321
    /* get bitmap for icon */
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8322
    if ( __isExternalAddress(wiconId) ) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8323
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8324
	if ( xBitMap != 0 ) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8325
	    BITMAP bm;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8326
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8327
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8328
		int d = bm.bmPlanes * bm.bmBitsPixel;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8329
		BYTE *ep;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8330
		int height, width;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8331
		int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8332
		unsigned char *allocatedBits = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8333
		int privateMask = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8334
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8335
		if ( __isExternalAddress(wiconMaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8336
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8337
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8338
		    if (wiconMaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8339
			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
  8340
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8341
		    maskBitmap = 0;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8342
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8343
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8344
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8345
		 * if there is no mask, generate one
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 (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8348
		    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
  8349
		    height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8350
		    width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8351
		    nBytes = ( width + 15 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8352
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8353
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8354
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8355
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8356
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8357
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8358
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8359
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8360
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8361
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8362
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8363
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8364
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8365
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8366
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8367
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8368
		    }
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
		if ( maskBitmap != NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8371
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8372
		    iconInfo.fIcon = TRUE;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8373
		    iconInfo.hbmMask  = maskBitmap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8374
		    iconInfo.hbmColor = xBitMap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8375
		    xIcon = CreateIconIndirect( &iconInfo );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8376
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  8377
			_DeleteObject( maskBitmap, __LINE__ );
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8378
		    }
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8379
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8380
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8381
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8382
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8383
		if (allocatedBits) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8384
		    free(allocatedBits);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8385
		}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8386
	    }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8387
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8388
	    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
  8389
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8390
    } else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8391
	if (wiconId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8392
	    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
  8393
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8394
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8395
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8396
    if (__bothSmallInteger(wwidth, wheight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8397
	w = __intVal(wwidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8398
	h = __intVal(wheight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8399
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8400
	w = h = 100;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8401
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8402
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8403
    if (__bothSmallInteger(xpos, ypos)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8404
	x = __intVal(xpos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8405
	y = __intVal(ypos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8406
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8407
	x = y = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8408
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8409
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8410
    if (__bothSmallInteger(minWidth, minHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8411
	min_width = __intVal(minWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8412
	min_height = __intVal(minHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8413
    } else {
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8414
	DPRINTF(("WinWorkstat [warning]: minWidth/minHeight not integer\n"))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8415
	min_width = min_height = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8416
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8417
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8418
    if (__bothSmallInteger(maxWidth, maxHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8419
	max_width = __intVal(maxWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8420
	max_height = __intVal(maxHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8421
    } else {
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8422
	DPRINTF(("WinWorkstat [warning]: maxWidth/maxHeight not integer\n"))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8423
	max_width = max_height = 10000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8424
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8425
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  8426
    winStyleBits = winEXStyleBits = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8427
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8428
    if (__isSmallInteger(bWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8429
	bw = __intVal(bWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8430
	if (bw) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8431
	    winStyleBits |= WS_BORDER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8432
	    bw = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8433
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8434
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8435
	bw = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8436
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8437
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8438
    className = app_name;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8439
    if (__isStringLike(windowClass)) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8440
	className = __stringVal(windowClass);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8441
	NDPRINTF(("className: %s\n", className));
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8442
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8443
	if (__isInteger(wStyle)) {
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8444
	    isNativeWindow = 1;
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8445
	    winStyleBits |= __longIntVal(wStyle);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8446
	    NDPRINTF(("winStyleBits: %x\n", winStyleBits));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8447
	} else {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8448
	    if (windowType != nil) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8449
		if (windowType == @symbol(RadioButton)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8450
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8451
		    winStyleBits |= BS_RADIOBUTTON;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8452
		    NDPRINTF(("class: %s - winStyleBits BS_RADIOBUTTON: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8453
		} else if (windowType == @symbol(CheckBox)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8454
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8455
		    winStyleBits |= BS_CHECKBOX;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8456
		    NDPRINTF(("class: %s - winStyleBits BS_CHECKBOX: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8457
		} else if (windowType == @symbol(HorizontalScrollBar)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8458
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8459
		    winStyleBits |= SBS_HORZ;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8460
		    NDPRINTF(("class: %s - winStyleBits SBS_HORZ: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8461
		} else if (windowType == @symbol(VerticalScrollBar)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8462
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8463
		    winStyleBits |= SBS_VERT;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8464
		    NDPRINTF(("class: %s - winStyleBits SBS_VERT: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8465
		} else if (windowType == @symbol(Button)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8466
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8467
		    NDPRINTF(("class: %s\n", className));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8468
		} else if (windowType == @symbol(OwnerDrawButton)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8469
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8470
		    winStyleBits |= BS_OWNERDRAW;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8471
		    NDPRINTF(("class: %s - winStyleBits BS_OWNERDRAW: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8472
		}
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8473
	    }
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8474
	}
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8475
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8476
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8477
    if (__isExternalAddress(wsuperViewId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8478
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8479
	 * a child window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8480
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8481
	parentHandle = _HANDLEVal(wsuperViewId);
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8482
	if (wStyle == @symbol(mdiChild)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8483
	    isMDIChild = 1;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8484
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8485
    } else {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8486
	parentHandle = NULL;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8487
	isTopWindow = 1;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8488
    }
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8489
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8490
    if (!isTopWindow && !isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8491
	/*
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8492
	 * a child window
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8493
	 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8494
	winStyleBits |= WS_CHILD;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8495
	if (winputOnly != true) {
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8496
	    winStyleBits |= (WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8497
	    /*winStyleBits |= WS_CLIPCHILDREN;*/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8498
	    DPRINTF(("parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8499
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8500
	    winEXStyleBits |= WS_EX_TRANSPARENT;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8501
	    DPRINTF(("inputview parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8502
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8503
#if 0
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8504
	winEXStyleBits |= WS_EX_NOPARENTNOTIFY;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8505
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8506
    } else {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8507
	/*
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8508
	 * a top window (regular / popUp / dialog) or MDIChild
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
	if (isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8511
	    winEXStyleBits |= WS_EX_MDICHILD;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8512
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8513
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8514
	if (! isMDIChild)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8515
	{
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8516
#ifdef TOPWINDOWCLASS
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8517
	    this could fail, since a pointer to local buf is passed
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8518
	    to the window-creation code (in the other thread ...)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8519
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8520
	    static winCount = 1;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8521
	    char buf[300];
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8522
	    char *stName;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8523
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8524
# ifdef __BORLANDC__
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8525
	    struct timeb timebuffer;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8526
	    ftime(&timebuffer);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8527
# else
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8528
	    struct _timeb timebuffer;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8529
	    _ftime(&timebuffer);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8530
# endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8531
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8532
	    if (__isStringLike(stClassName)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8533
		stName = __stringVal(stClassName);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8534
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8535
		stName = app_name;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8536
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8537
	    sprintf(buf, "S%d.%d%s", HIWORD(timebuffer.time), ++winCount, stName);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8538
	    DPRINTF(("topview - registerClass:%s\n",buf));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8539
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8540
	    wc.style = /* CS_HREDRAW | CS_VREDRAW | CS_OWNDC  |*/ CS_DBLCLKS;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8541
	    wc.lpfnWndProc = (WNDPROC) MainWndProc;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8542
	    wc.cbClsExtra = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8543
	    wc.cbWndExtra = N_WINDOW_PRIVATE;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8544
	    wc.hInstance = (HANDLE) __getHInstance();
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8545
	    if (xIcon) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8546
		wc.hIcon   = xIcon;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8547
		/* 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
  8548
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8549
		wc.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8550
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8551
	    wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8552
	    wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8553
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8554
	    wc.lpszMenuName =  NULL;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8555
	    wc.lpszClassName = buf;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8556
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8557
	    if (!RegisterClass(&wc)) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8558
		PRINTF(("RegisterClass failed\n"));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8559
		RETURN( nil );
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8560
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8561
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8562
	    className = buf;
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8563
#endif /* TOPWINDOWCLASS */
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8564
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8565
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8566
	if (wStyle == @symbol(popUp)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8567
	    winStyleBits |= WS_POPUP;
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8568
	    // winStyleBits |= WS_DISABLED;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8569
	    winEXStyleBits |= WS_EX_TOOLWINDOW;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8570
	    CPRINTF(("Create popUpWindow\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8571
#if 0
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8572
	    parentHandle = GetActiveWindow();
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8573
#endif
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8574
	} else if (wStyle == @symbol(popUpWithFrame)) {
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8575
	    winStyleBits |= WS_POPUP | WS_THICKFRAME /* | WS_CAPTION | DS_MODALFRAME | WS_SIZEBOX */ ;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8576
	    // winStyleBits |= WS_DISABLED;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8577
	    // winEXStyleBits |= WS_EX_TOOLWINDOW;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8578
	    CPRINTF(("Create popUpWindow\n"));
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8579
#if 0
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8580
	    parentHandle = GetActiveWindow();
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8581
#endif
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8582
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8583
	} else if ((wStyle == @symbol(dialog)) || (wStyle == @symbol(toolDialog))) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8584
	    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
  8585
	    winStyleBits |= WS_POPUP;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8586
	    winStyleBits |= DS_NOIDLEMSG;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  8587
	    //winEXStyleBits |= WS_EX_TOOLWINDOW;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8588
	    if ((min_width || min_height)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8589
	     && (min_width == max_width)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8590
	     && (min_height == max_height)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8591
		winStyleBits &= ~WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8592
	    }
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8593
	    if (wStyle == @symbol(toolDialog)) {
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8594
		winEXStyleBits |= WS_EX_TOOLWINDOW;
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8595
	    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8596
	} else if (wStyle == @symbol(undecorated)) {
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8597
	    winStyleBits |= WS_OVERLAPPED;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8598
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8599
	} else if (wStyle == @symbol(undecoratedResizable)) {
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8600
	    winStyleBits |= WS_OVERLAPPED | WS_THICKFRAME;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8601
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8602
	} else if (isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8603
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | DS_MODALFRAME | WS_SYSMENU | WS_SIZEBOX;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8604
	    if ((min_width || min_height)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8605
	     && (min_width == max_width)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8606
	     && (min_height == max_height)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8607
		winStyleBits &= ~WS_THICKFRAME;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8608
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8609
	} else {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8610
	    //winStyleBits |= WS_OVERLAPPEDWINDOW;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8611
	    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
  8612
	    //winEXStyleBits |= WS_EX_CLIENTEDGE;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  8613
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  8614
	    //winEXStyleBits |= WS_EX_ACCEPTFILES;
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8615
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8616
	    if (wStyle == @symbol(toolWindow)) {
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8617
		winEXStyleBits |= WS_EX_TOOLWINDOW;
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8618
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8619
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8620
	winStyleBits |= WS_CLIPCHILDREN;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8621
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8622
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8623
    rec.left = x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8624
    rec.top = y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8625
    rec.right = x + w;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8626
    rec.bottom = y+ h;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8627
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8628
    /* use static memory for the createwindowInfo;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8629
     * 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
  8630
     * 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
  8631
     * when in a sizeMove-loop.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8632
     * (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
  8633
     *  early via the pending- mechanism)
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8634
     * 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
  8635
     * 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
  8636
     * 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
  8637
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8638
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
     * check if previous request has been properly processed ...
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
    if (cwi.sequenceNr && (cwi.sequenceNr != INVALIDATED_CWI)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8643
	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
  8644
	/* this prevents the event processor from interpreting this message */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8645
	cwi.sequenceNr = nextSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8646
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8647
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8648
    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
  8649
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8650
#ifdef ADJUSTWINDOW
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8651
    AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8652
    w = rec.right - rec.left;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8653
    h = rec.bottom - rec.top;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8654
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8655
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8656
    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
  8657
		((wStyle == @symbol(popUp)) ? " popUp" : ""),
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8658
		x, y, w, h,
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8659
		bw, parentHandle, className,
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8660
		winStyleBits, winEXStyleBits));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8661
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8662
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8663
    lI = (localWindowInfo *) malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8664
    if (! lI) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8665
	console_fprintf(stderr, "WinWorkstation [error]: malloc failed in CreateWindow\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8666
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8667
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8668
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8669
    memset(lI, 0, sizeof(localWindowInfo));
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8670
    lI->mouseX = lI->mouseY = -9999;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8671
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8672
    if (isTopWindow) {
6565
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  8673
/****** MULTI SCREEN   CATZKERN *********
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8674
	if (rec.left < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8675
	    rec.left = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8676
	    rec.right = w;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8677
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8678
	if (rec.top < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8679
	    rec.top = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8680
	    rec.bottom = h;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8681
	}
6565
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  8682
****** MULTI SCREEN   CATZKERN *********/
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  8683
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8684
	lI->flag |= LI_TOPWIN;
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  8685
    } else {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8686
	if (bw) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8687
	    // adjust for border
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8688
	    rec.left++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8689
	    rec.top++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8690
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8691
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8692
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8693
    if (winputOnly == true) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8694
	lI->flag |= LI_INPUTWIN;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8695
    }
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8696
    if (isNativeWindow) {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  8697
	NDPRINTF(("set native flag\n"));
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8698
	lI->flag |= LI_NATIVEWIN;
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8699
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8700
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8701
    if (wStyle == @symbol(popUp)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8702
	cwi.className = wapp_namePopup;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8703
    } else {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8704
	if (wStyle == @symbol(dialog)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8705
	    cwi.className = wapp_nameDialog;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8706
	} else {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8707
	    ch2wch(className, classNameBufferw, MAX_CLASSNAME_SIZE);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8708
	    cwi.className = classNameBufferw;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8709
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8710
    }
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8711
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8712
    cwi.winStyleBits = winStyleBits;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8713
    cwi.parentHandle = parentHandle;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8714
    cwi.x = rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8715
    cwi.y = rec.top;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8716
    cwi.dx = rec.right - rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8717
    cwi.dy = rec.bottom - rec.top;
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8718
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8719
    if (isTopWindow | isMDIChild) {
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8720
	rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8721
	rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8722
	rec.right = min_width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8723
	rec.bottom = min_height;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8724
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8725
	AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8726
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8727
	lI->minWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8728
	lI->minHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8729
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8730
	rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8731
	rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8732
	rec.right = max_width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8733
	rec.bottom = max_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8734
#ifdef ADJUSTWINDOW
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8735
	AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8736
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8737
	lI->maxWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8738
	lI->maxHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8739
    } else {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8740
	lI->minWidth = lI->minHeight = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8741
	lI->maxWidth = lI->maxHeight = 9999;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8742
    }
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  8743
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  8744
    lI->viewBgBrush = __whiteBrush;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  8745
    lI->viewBgColor = WhitePixel;
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  8746
    lI->bdColor = BlackPixel;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  8747
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8748
    if (__isSmallInteger(eventMask))
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8749
	lI->eventMask = __intVal(eventMask);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8750
    else
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  8751
	lI->eventMask = ~0;
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  8752
    DPRINTF(("eventMask is %x\n", lI->eventMask));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8753
#ifdef DEBUGMASK1
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8754
    printMask(lI->eventMask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8755
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8756
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8757
    lI->bw = bw;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8758
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8759
    cwi.newWinHandle = newWindowHandle = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8760
    cwi.windowName = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8761
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8762
    if (isTopWindow | isMDIChild) {
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8763
	if (__isStringLike(wlabel)) {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8764
	    ch2wch((char *)__stringVal(wlabel), windowNameBufferw, MAX_LABEL_SIZE);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8765
	    cwi.windowName = windowNameBufferw;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8766
	} else
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8767
	    if (__isUnicode16String(wlabel)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8768
		int l = __unicode16StringSize(wlabel);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8769
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8770
		if (l >= MAX_LABEL_SIZE) l = MAX_LABEL_SIZE-1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8771
		memmove(windowNameBufferw, __unicode16StringVal(wlabel), l*sizeof(wchar_t));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8772
		windowNameBufferw[ l ] = 0;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8773
		cwi.windowName = windowNameBufferw;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8774
	    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8775
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8776
2665
4b88034ccb36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2664
diff changeset
  8777
    cwi.infoWasRead = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8778
    cwi.localWindowInfo = lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8779
    cwi.sequenceNr = nextSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8780
    nextSequenceNr = (nextSequenceNr + 1) & 0x7FFF;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8781
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8782
#ifndef NEW_CREATE_EVENT
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8783
    cwi.hCreateEvent = hCreateEvent;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8784
    ResetEvent(cwi.hCreateEvent);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8785
#else
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8786
    /* creating a new event does not work - why ? */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8787
    cwi.hCreateEvent = CreateEvent(
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8788
	NULL,        /* no security attributes */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8789
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8790
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8791
	NULL);       /* name of mutex */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8792
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8793
    if (cwi.hCreateEvent == NULL) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8794
	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
  8795
	cwi.sequenceNr = INVALIDATED_CWI;
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8796
	free(lI);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8797
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8798
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8799
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8800
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8801
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8802
     * kludge to allow for createWindow while in sizeMove processing loop
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
    if (pendingCREATEWINDOWInfo) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8805
	console_fprintf(stderr, "WinWorkstation [error]: oops - pending create\n");
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8806
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8807
    pendingCREATEWINDOWInfo = &cwi;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8808
    pendingSequenceNr = cwi.sequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8809
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  8810
    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
  8811
	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
  8812
					_dispatchThreadId, GetLastError() );
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8813
	free(lI);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8814
	RETURN (nil);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8815
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8816
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8817
    if (cwi.newWinHandle != NULL) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8818
	cwi.sequenceNr = INVALIDATED_CWI;
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  8819
	cwi.hCreateEvent = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8820
	/* wow - that was quick ... */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8821
    } else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8822
	DWORD dwWaitResult;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8823
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8824
	/* wait for the window to be created ... */
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  8825
	dwWaitResult = WaitForSingleObject(hCreateEvent, 5000L);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8826
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8827
	/* no longer want to get informed ... */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8828
	cwi.hCreateEvent = NULL;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8829
	cwi.sequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8830
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8831
	switch (dwWaitResult) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8832
	    // The thread got mutex ownership.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8833
	    case WAIT_OBJECT_0:
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8834
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8835
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8836
	    // Cannot get mutex ownership due to time-out.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8837
	    case WAIT_TIMEOUT:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8838
		DEBUGFPRINTF((stderr, "WinWorkstation [error]: oops - timeout in CreateWindow\n"));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8839
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8840
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8841
	    // Got ownership of the abandoned mutex object.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8842
	    default:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8843
		DEBUGFPRINTF((stderr, "WinWorkstation [warning]: CreateEvent abandoned\n"));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8844
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8845
	}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8846
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8847
#ifdef NEW_CREATE_EVENT
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8848
	CloseHandle(cwi.hCreateEvent);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8849
#endif
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8850
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8851
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8852
    pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8853
    newWindowHandle = cwi.newWinHandle;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8854
    DPRINTF(("handle = %x\n", newWindowHandle));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8855
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8856
    if (! newWindowHandle) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8857
	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
  8858
			cwi.errCode, cwi.errCode, __LINE__ );
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  8859
	if (cwi.infoWasRead) {
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  8860
	    free(lI);
4284
5efcb512f038 *** empty log message ***
ca
parents: 4281
diff changeset
  8861
	} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8862
	    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
  8863
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8864
	RETURN ( nil );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8865
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8866
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8867
#ifdef CACHE_LAST_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8868
    if (lastGcData && (lastGcHWIN == newWindowHandle)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8869
	_releaseDC(lastGcData);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8870
    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8871
#endif
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8872
#ifdef CACHE_LAST_WM_PAINT_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8873
    if (last_wm_paint_dc && (last_wm_paint_win == newWindowHandle)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8874
	ReleaseDC(newWindowHandle, last_wm_paint_dc);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8875
	last_wm_paint_win = last_wm_paint_dc = 0;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8876
    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8877
#endif
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8878
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8879
    windowId = __MKOBJ(newWindowHandle);
4368
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8880
#if 1
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8881
    if (isTopWindow | isMDIChild) {
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8882
	/*
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8883
	 * mhmh - what is that raise for ?
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8884
	 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8885
	SetWindowPos(newWindowHandle, HWND_TOP, 0, 0, 0, 0,
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8886
		     SWP_NOSENDCHANGING |
4368
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8887
		     /* SWP_NOACTIVATE | */ SWP_NOMOVE | SWP_NOSIZE);
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8888
    } else {
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8889
	SetWindowPos(newWindowHandle, HWND_TOP, 0, 0, 0, 0,
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8890
		     SWP_NOSENDCHANGING |
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8891
		     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8892
    }
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8893
#endif
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8894
    if (isTopWindow | isMDIChild) {
2697
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  8895
	BringWindowToTop(newWindowHandle);
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  8896
    }
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8897
    DragAcceptFiles(newWindowHandle, 1);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8898
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8899
    if (isNativeWindow) {
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8900
	if (winStyleBits & (SBS_HORZ | SBS_VERT)) {
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  8901
	    SetScrollRange(newWindowHandle, SB_CTL, 0, 100, 0);
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  8902
	    SetScrollPos(newWindowHandle, SB_CTL, 0, 0);
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8903
	}
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8904
    }
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8905
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8906
#ifndef TOPWINDOWCLASS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8907
    if (xIcon) {
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  8908
	SendMessage(newWindowHandle, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)xIcon);
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  8909
	SendMessage(newWindowHandle, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)xIcon);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8910
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8911
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8912
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  8913
    DPRINTF(("done - create h=%x\n", newWindowHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8914
    RETURN (windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8915
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8916
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8917
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8918
primDestroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8919
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8920
%{  /* NOCONTEXT */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8921
    HICON oldIcon;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8922
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8923
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8924
	HWND win = _HWNDVal(aWindowId);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8925
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8926
	if (win && IsWindow(win)) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8927
#ifndef TOPWINDOWCLASS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  8928
# ifdef _WIN64
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  8929
	    oldIcon = (HICON) GetClassLongPtr(win, GCLP_HICON);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  8930
	    SetClassLongPtr(win, GCLP_HICON, (INT)0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  8931
# else
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8932
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8933
	    SetClassLong(win, GCL_HICON, (DWORD)0);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  8934
# endif
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8935
	    /* 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
  8936
	    if ( oldIcon ) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8937
		if ( DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8938
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8939
		} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8940
		    console_fprintf(stderr, "failed to destroy icon\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8941
		}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8942
	    }
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8943
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8944
	   /*console_printf("post WM_THREAD_DESTROYWINDOW\n");*/
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8945
	    PostMessage(win, WM_THREAD_DESTROYWINDOW, 0, 0);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8946
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8947
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8948
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8949
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8950
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8951
rootWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8952
    "return the id of the root window.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8953
     This is the window you see as background,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8954
     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
  8955
     since some window managers install a virtual root window on top
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8956
     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
  8957
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8958
    ^ rootWin
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8959
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8960
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8961
!WinWorkstation methodsFor:'clipboard'!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8962
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8963
getClipboardObjectFor:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8964
    "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
  8965
     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
  8966
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8967
    |currentSequenceNumber|
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 := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8970
    lastClipboardSequenceNumber ~= currentSequenceNumber ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8971
	"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
  8972
	 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
  8973
	 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
  8974
	 behavior."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8975
	copyBuffer := self getClipboardData.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8976
	lastClipboardSequenceNumber := currentSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8977
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8978
    ^ copyBuffer
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
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8981
getClipboardText:selectionBufferSymbol for:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8982
     "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
  8983
      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
  8984
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8985
    |currentSequenceNumber|
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 := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8988
    lastClipboardSequenceNumber ~= currentSequenceNumber ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8989
	"copyBuffer is invalid, fill it from the windows clipboard.
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8990
	 Even if we could not decode the windows clipboard,
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8991
	 we intentionally set the copyBuffer to nil to get a consistent
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8992
	 behavior."
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8993
	copyBuffer := self getClipboardData.
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8994
	lastClipboardSequenceNumber := currentSequenceNumber.
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8995
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8996
    ^ self copyBufferAsString
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8997
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8998
    "
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8999
     Screen current getClipboardText:#clipboard for:nil
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
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9002
    "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
  9003
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9004
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9005
setClipboardObject:something owner:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9006
    "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
  9007
     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
  9008
     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
  9009
     to other applications."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9010
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9011
    something isString ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9012
	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
  9013
	^ self
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9014
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9015
    something isStringCollection ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9016
	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
  9017
	^ self
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9018
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9019
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9020
    "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
  9021
     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
  9022
    lastClipboardSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9023
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9024
    "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
  9025
    "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
  9026
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9027
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9028
setClipboardText:something owner:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9029
    "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
  9030
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9031
    |result|
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 := 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
  9034
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9035
    "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
  9036
    lastClipboardSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9037
    ^ result.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9038
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9039
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9040
    "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
  9041
    "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
  9042
! !
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9043
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9044
!WinWorkstation methodsFor:'clipboard-private'!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9045
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9046
getClipboardData
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9047
    "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
  9048
     Answer a string on success or nil otherwise.
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9049
     Caveat: for now, only Text and UnicodeText are supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9050
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9051
    |data|
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 := self getUnicodeClipboardData) notNil ifTrue:[^ data].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9054
    (data := self getTextClipboardData) notNil ifTrue:[^ data].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9055
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9056
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9057
    "Modified: / 09-10-2007 / 12:47:02 / cg"
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
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9060
getClipboardDataBytes:format
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9061
    "get the contents of the windows clipboard as raw bytes.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9062
     Answer an image on success or nil otherwise."
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9063
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9064
    |bytes|
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9065
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9066
%{
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9067
    HANDLE hData;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9068
    unsigned char *src, *p;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9069
    WIDECHAR *w_src, *w_p;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9070
    int fmt;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9071
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9072
    if (format == @symbol(CF_TIFF)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9073
	fmt = CF_TIFF;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9074
    } else if (format == @symbol(CF_BITMAP)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9075
	fmt = CF_BITMAP;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9076
    } else if (format == @symbol(CF_DIB)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9077
	fmt = CF_DIB;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9078
    } else
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9079
	goto badFormat;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9080
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9081
    if (IsClipboardFormatAvailable(fmt)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9082
	int len;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9083
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9084
	if (OpenClipboard(NULL)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9085
	    hData = GetClipboardData(fmt);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9086
	    if (hData) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9087
		len = GlobalSize(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9088
		src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9089
		if (src) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9090
		    bytes = __MKBYTEARRAY(src, len);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9091
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9092
		GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9093
		CloseClipboard();
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  9094
		DDPRINTF(("WinWorkstation [info]: clipBoard data size is <%d>\n", len));
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9095
		RETURN(bytes);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9096
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9097
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9098
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9099
badFormat: ;
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
    ^ nil
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
    "
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9104
     Screen current getClipboardDataBytes:#CF_TIFF
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9105
     Screen current getClipboardDataBytes:#CF_BITMAP
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9106
     Screen current getClipboardDataBytes:#CF_DIB
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9107
    "
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9108
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9109
    "Created: / 09-10-2007 / 13:11:12 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9110
    "Modified: / 09-10-2007 / 14:18:26 / cg"
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9111
!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9112
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9113
getClipboardOwner
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9114
    "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
  9115
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9116
%{
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9117
    HANDLE hWnd;
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
    hWnd = GetClipboardOwner();
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9120
    RETURN(__MKEXTERNALADDRESS(hWnd));
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9121
%}
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9122
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
	Screen current getClipboardOwner
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
!
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
getClipboardSequenceNumber
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9129
    "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
  9130
     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
  9131
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9132
%{
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9133
    DWORD sequenceNumber;
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
    sequenceNumber = GetClipboardSequenceNumber();
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9136
    RETURN(__MKUINT(sequenceNumber));
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9137
%}
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9138
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
	Screen current getClipboardSequenceNumber
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9141
   "
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9142
!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9143
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9144
getImapeClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9145
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9146
     Answer an image on success or nil otherwise."
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9147
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9148
    |data|
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 := self getClipboardDataBytes:#CF_TIFF) notNil ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9151
	"/ tiff image in data...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9152
	^ "TIFFReader fromBytes:data" nil
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9153
    ].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9154
    (data := self getClipboardDataBytes:#CF_DIB) notNil ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9155
	"/ device independent bitmap image in data...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9156
	^ "TIFFReader fromBytes:data" nil
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9157
    ].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9158
    ^ nil
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
    "Created: / 09-10-2007 / 14:19:53 / cg"
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
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9163
getTextClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9164
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9165
     Answer a string on success or nil otherwise.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9166
     Caveat: for now, only Text is supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9167
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9168
%{
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9169
    HANDLE hData;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9170
    OBJ s;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9171
    unsigned char *src, *p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9172
    WIDECHAR *w_src, *w_p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9173
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9174
    /* check for format CF_TEXT */
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9175
    if (IsClipboardFormatAvailable(CF_TEXT)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9176
	int nRemain, len, realLen;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9177
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9178
	if (OpenClipboard(NULL)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9179
	    hData = GetClipboardData(CF_TEXT);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9180
	    src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9181
	    len = src ? strlen(src) : 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9182
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9183
	    /* 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
  9184
	    for (realLen=nRemain=len, p=src; nRemain; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9185
		unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9186
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9187
		ch = *p++; nRemain--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9188
		if (ch == 0x0D) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9189
		    if (nRemain && (*p == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9190
			p++; nRemain--;realLen--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9191
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9192
		}
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
	    s = __MKEMPTYSTRING(realLen);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9195
	    if (s != nil) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9196
		for (p=__stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9197
		    unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9198
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9199
		    *p = ch = *src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9200
		    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9201
		    if (len && (ch == 0x0D) && (*src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9202
			*p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9203
			src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9204
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9205
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9206
		    p++;
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
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9209
	    GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9210
	    CloseClipboard();
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  9211
	    DDPRINTF(("WinWorkstation [info]: clipBoard data is <%s>\n", (char *)hData));
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9212
	    RETURN(s);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9213
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9214
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9215
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9216
    ^ nil
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
    "Created: / 09-10-2007 / 12:46:00 / cg"
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
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9221
getUnicodeClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9222
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9223
     Answer a string on success or nil otherwise.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9224
     Caveat: for now, only Text is supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9225
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9226
%{
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9227
    HANDLE hData;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9228
    OBJ s;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9229
    unsigned char *src, *p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9230
    WIDECHAR *w_src, *w_p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9231
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9232
    /* Unicode */
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9233
    if (IsClipboardFormatAvailable(CF_UNICODETEXT)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9234
	int nRemain, len, realLen;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9235
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9236
	if (OpenClipboard(NULL)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9237
	    int needUnicode = 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9238
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9239
	    hData = GetClipboardData(CF_UNICODETEXT);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9240
	    w_src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9241
	    len = w_src ? wcslen(w_src) : 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9242
	    /*
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9243
	     * 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
  9244
	     * and if result is really Unicode ...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9245
	     */
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9246
	    for (realLen=nRemain=len, w_p=w_src; nRemain; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9247
		WIDECHAR w_ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9248
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9249
		w_ch = *w_p++; nRemain--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9250
		if ((unsigned) w_ch > 0xFF) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9251
		    needUnicode = 1;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9252
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9253
		if (w_ch == 0x0D) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9254
		    if (nRemain && (*w_p == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9255
			w_p++; nRemain--;realLen--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9256
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9257
		}
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
	    if (! needUnicode) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9260
		s = __MKEMPTYSTRING(realLen);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9261
		if (s != nil) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9262
		    for (p = __stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9263
			unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9264
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9265
			*p = ch = *w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9266
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9267
			if (len && (ch == 0x0D) && (*w_src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9268
			    *p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9269
			    w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9270
			    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9271
			}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9272
			p++;
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
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9275
	    } else {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9276
		s = __BYTEARRAY_NEW_INT(realLen * 2);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9277
		if (s != nil) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9278
		    __objPtr(s)->o_class = @global(Unicode16String);
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9279
		    for (w_p = (WIDECHAR *)__stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9280
			WIDECHAR w_ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9281
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9282
			*w_p = w_ch = *w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9283
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9284
			if (len && (w_ch == 0x0D) && (*w_src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9285
			    *w_p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9286
			    w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9287
			    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9288
			}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9289
			w_p++;
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
		}
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
	    GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9294
	    CloseClipboard();
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9295
	    RETURN(s);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9296
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9297
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9298
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9299
    ^ nil
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
    "Created: / 09-10-2007 / 12:45:26 / cg"
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
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9304
setClipboardData:aString
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9305
    "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
  9306
     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
  9307
     Caveat: for now, only Text is supported."
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9308
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9309
%{
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9310
    HANDLE hData;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9311
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  9312
    if (__isStringLike(aString)) {
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9313
	char *s, *p, *src, *dst;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9314
	int n, len, realLen;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9315
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9316
	if (OpenClipboard(NULL)) {
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9317
	    s = __stringVal(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9318
	    /* must replace CR by CRLF */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9319
	    len = realLen = __stringSize(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9320
	    for (src=s, n=len; n; n--) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9321
		if ((src[0] == 0x0A) && ((src == s) || (src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9322
		    realLen++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9323
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9324
		src++;
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
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9327
	    hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, realLen+1);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9328
	    if (hData) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9329
		char *t = GlobalLock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9330
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9331
		if (t) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9332
		    for (src=s, dst=t, n=len; n;) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9333
			unsigned char ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9334
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9335
			ch = src[0]; n--;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9336
			if ((ch == 0x0A) && ((src == s) || (src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9337
			    *dst++ = 0x0D;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9338
			    *dst++ = 0x0A;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9339
			} else {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9340
			    *dst++ = ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9341
			}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9342
			src++;
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
		    *dst = 0;
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
		    EmptyClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9347
		    if (SetClipboardData(CF_TEXT, hData) != 0) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9348
			/* Note: After setting clipboard data,
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9349
			 * the memory block previously allocated belongs to
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9350
			 * the clipboard - not to the app.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9351
			 */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9352
			CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9353
			RETURN (true);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9354
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9355
		    DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9356
		    GlobalUnlock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9357
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9358
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9359
	    CloseClipboard();
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
	RETURN(false);
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
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9364
    /* Unicode */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9365
    if (__isWords(aString)) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9366
	WIDECHAR *w_s, *w_p, *w_src, *w_dst;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9367
	int n, len, realLen;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9368
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9369
	if (OpenClipboard(NULL)) {
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9370
	    OBJ cls;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9371
	    int nInstBytes;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9372
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9373
	    cls = __qClass(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9374
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9375
	    w_s = (WIDECHAR *)(__stringVal(aString) + nInstBytes);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9376
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9377
	    /* must replace CR by CRLF */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9378
	    len = realLen = (__byteArraySize(aString) - nInstBytes) / 2;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9379
	    for (w_src=w_s, n=len; n; n--) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9380
		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
  9381
		    realLen++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9382
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9383
		w_src++;
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
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9386
	    hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, (realLen+1)*sizeof(WIDECHAR));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9387
	    if (hData) {
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
  9388
		WIDECHAR *t = GlobalLock(hData);
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9389
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9390
		if (t) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9391
		    for (w_src=w_s, w_dst=t, n=len; n;) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9392
			WIDECHAR w_ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9393
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9394
			w_ch = w_src[0]; n--;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9395
			if ((w_ch == 0x0A) && ((w_src == w_s) || (w_src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9396
			    *w_dst++ = 0x0D;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9397
			    *w_dst++ = 0x0A;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9398
			} else {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9399
			    *w_dst++ = w_ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9400
			}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9401
			w_src++;
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_dst = 0;
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
		    EmptyClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9406
		    if (SetClipboardData(CF_UNICODETEXT, hData) != 0) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9407
			/* Note: After setting clipboard data,
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9408
			 * the memory block previously allocated belongs to
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9409
			 * the clipboard - not to the app.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9410
			 */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9411
			CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9412
			RETURN (true);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9413
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9414
		    DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9415
		    GlobalUnlock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9416
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9417
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9418
	    CloseClipboard();
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
	RETURN(false);
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
%}.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9423
    self primitiveFailed.
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
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9426
!WinWorkstation methodsFor:'color stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9427
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9428
colorRed:redVal green:greenVal blue:blueVal
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9429
    "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
  9430
     This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9431
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9432
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9433
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9434
    r := self percentToDeviceColorValue:redVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9435
    g := self percentToDeviceColorValue:greenVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9436
    b := self percentToDeviceColorValue:blueVal.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9437
    ^ self colorScaledRed:r scaledGreen:g scaledBlue:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9438
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9439
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9440
colorScaledRed:r scaledGreen:g scaledBlue:b
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9441
    "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
  9442
     (i.e. colorID)"
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9443
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9444
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9445
    int id, ir, ig, ib;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9446
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  9447
    if (__bothSmallInteger(r, g) && __isSmallInteger(b)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  9448
	id = RGB2st(__intVal(r),__intVal(g),__intVal(b));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9449
	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
  9450
	RETURN ( __MKSMALLINT(id) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9451
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9452
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9453
    self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9454
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9455
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9456
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9457
freeColor:colorIndex
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  9458
    "free a display color when its no longer needed.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  9459
     A dummy here, since RGB colors are never freed."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9460
4074
b40ae99d0f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  9461
    "/ 'free color' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9462
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9463
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9464
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9465
getRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9466
    "get rgb components (0..100) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9467
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9468
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9469
    |val|
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
    self getScaledRGBFrom:index into:[:r :g :b |
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9472
	val := aBlock
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9473
		value:(r * 100.0 / 16rFFFF)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9474
		value:(g * 100.0 / 16rFFFF)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9475
		value:(b * 100.0 / 16rFFFF)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9476
    ].
4074
b40ae99d0f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  9477
    "/ 'get RGB' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9478
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9479
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9480
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9481
getRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9482
    "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
  9483
     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
  9484
     Return nil for unknown color names."
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9485
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9486
    |val|
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
    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
  9489
	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
  9490
	val := aBlock
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9491
		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
  9492
		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
  9493
		value:(b * 100.0 / 16rFFFF)
5338
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9494
    ].
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9495
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9496
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9497
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9498
getScaledRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9499
    "get rgb components (0 .. 16rFFFF) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9500
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9501
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9502
    |r g b|
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
    int id = __intVal(index);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9505
    int iR, iG, iB;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9506
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9507
    id = st2RGB(id,0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9508
    iR = id & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9509
    iG = (id >> 8) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9510
    iB = (id >> 16) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9511
    iR = (iR << 8) | iR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9512
    iG = (iG << 8) | iG;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9513
    iB = (iB << 8) | iB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9514
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9515
    r = __MKSMALLINT(iR);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9516
    g = __MKSMALLINT(iG);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9517
    b = __MKSMALLINT(iB);
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9518
    /*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
  9519
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9520
    ^ aBlock value:r value:g value:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9521
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9522
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9523
getScaledRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9524
    "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
  9525
     and evaluate the 3-arg block, aBlock with them.
7677
e79cf02d0d4a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7614
diff changeset
  9526
     Return nil for unknown color names or invalid hex numbers."
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9527
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  9528
    |triple r g b found cName|
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9529
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9530
    r := g := b := 0.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9531
    found := false.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9532
    (colorName startsWith:$#) ifTrue:[
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9533
	"/ color in r/g/b hex notation
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9534
	colorName size == 7 ifTrue:[
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9535
	    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
  9536
	    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
  9537
	    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
  9538
	].
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9539
	(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
  9540
	found := true.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9541
    ] ifFalse:[
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9542
	cName := colorName asString.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9543
	triple := StandardColorValues at:cName ifAbsent:nil.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9544
	triple isNil ifTrue:[
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9545
	    "/ try lowercase name
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9546
	    cName := cName asLowercase.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9547
	    triple := StandardColorValues at:cName ifAbsent:nil.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9548
	    triple isNil ifTrue:[
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9549
		"/ try lowercase without intermixed spaces
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9550
		cName := cName asCollectionOfWords asStringWith:nil.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9551
		triple := StandardColorValues at:cName ifAbsent:nil.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9552
	    ].
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9553
	].
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9554
	triple notNil ifTrue:[
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9555
	    r := triple at:1.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9556
	    g := triple at:2.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9557
	    b := triple at:3.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9558
	    found := true.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9559
	].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9560
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9561
    found ifFalse:[
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9562
	"/ ('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9563
	^ nil.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9564
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9565
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9566
    ^ 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
  9567
e79cf02d0d4a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7614
diff changeset
  9568
    "Modified (comment): / 14-11-2016 / 14:02:11 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9569
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9570
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9571
listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9572
    "return a list of all available colornames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9573
     This should not be used, since colornames are very
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9574
     display-specific (here X-specific)."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9575
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9576
    |aStream list line index colorName|
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 := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9579
    aStream isNil ifTrue:[^ nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9580
    list := OrderedCollection new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9581
    [aStream atEnd] whileFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9582
	line := aStream nextLine.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9583
	line notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9584
	    "skip the r/g/b numbers"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9585
	    index := 1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9586
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9587
	    [(line at:index) isDigit] whileTrue:[index := 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
	    colorName := line copyFrom:index.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9594
	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9595
		list add:colorName
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9596
	    ]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9597
	]
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
    aStream close.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9600
    ^ list sort
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9601
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9602
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9603
     Screen current listOfAvailableColors
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
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9606
    "Modified: 11.9.1996 / 15:26:28 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9607
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9608
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9609
percentToDeviceColorValue:aPercentage
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9610
    "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
  9611
     WIN-component value (0..16rFFFF) as an integer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9612
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9613
%{  /* NOCONTEXT */
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
    if (__isSmallInteger(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9616
	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9617
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9618
    if (__isFloat(aPercentage)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9619
	RETURN ( __MKSMALLINT(0xFFFF * (INT)(__floatVal(aPercentage)) / 100) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9620
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9621
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9622
    ^ (16rFFFF * aPercentage / 100) rounded
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9623
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9624
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9625
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
  9626
    "change a palette index.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9627
     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
  9628
     - 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
  9629
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9630
     '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
  9631
     ^ self.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9632
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9633
    "Created: 30.1.1998 / 09:27:48 / md"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9634
    "Modified: 30.1.1998 / 09:30:22 / md"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9635
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9636
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9637
!WinWorkstation methodsFor:'cursor stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9638
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9639
builtInCursorShapes
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9640
    "return a collection of standard cursor names.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9641
     Those are built into Windows and need not be created as
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9642
     user cursors.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9643
     (actually, there are more than those below ...)"
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9644
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9645
    "/ if you add something here, also add to #shapeNumberFromCursor ...
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
    ^ #(
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9648
	#upLeftArrow            "/ IDC_ARROW
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9649
	#upDownArrow            "/ IDC_SIZENS
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9650
	#leftRightArrow         "/ IDC_SIZEWE
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9651
	#text                   "/ IDC_IBEAM
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9652
	#wait                   "/ IDC_WAIT
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9653
	#execute                "/ IDC_APPSTARTING
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9654
	#crossHair              "/ IDC_CROSS
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9655
	#fourWay                "/ IDC_SIZEALL
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9656
	#upRightHand            "/ IDC_ARROW
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9657
	#noDrop                 "/ IDC_NO
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9658
	#stop                   "/ IDC_NO
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9659
       )
3110
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9660
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9661
    "Modified: / 10.12.1999 / 15:16:26 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9662
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9663
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9664
createCursorShape:aShape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9665
    "create a cursor given a shape-symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9666
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9667
    |number|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9668
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9669
    number := self shapeNumberFromSymbol:aShape.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9670
    number isNil ifTrue:[^ nil].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9671
    ^ self primCreateCursorShapeNr:number
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9672
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9673
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9674
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
  9675
    "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
  9676
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9677
    |padding bpl bplPadded srcOffs dstOffs
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9678
     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
  9679
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9680
    cW := self getSystemMetrics:#SM_CXCURSOR.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9681
    cH := self getSystemMetrics:#SM_CYCURSOR.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9682
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9683
    "/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9684
    src := sourceBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9685
    mask := maskBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9686
    padding := self cursorBitmapPadding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9687
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9688
    "/ repadding and/or resizing required ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9689
    bpl := sourceBytes size / h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9690
    bplPadded := (cW + padding - 1) // padding * 2.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9691
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9692
    bpl ~~ bplPadded ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9693
	 "/     'repad cursor bits' infoPrintCR.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9694
	srcPadded := ByteArray new:(bplPadded * cH).
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9695
	nB := bpl min: bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9696
	nR := cH min: h.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9697
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9698
	dstOffs := srcOffs := 1.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9699
	1 to:nR do:[:row |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9700
	    srcPadded
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9701
		replaceFrom:dstOffs
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9702
		to:(dstOffs+nB-1)
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9703
		with:src
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9704
		startingAt:srcOffs.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9705
	    dstOffs := dstOffs + bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9706
	    srcOffs := srcOffs + bpl.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9707
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9708
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9709
	maskPadded := ByteArray new:(bplPadded * cH).
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9710
	dstOffs := srcOffs := 1.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9711
	1 to:nR do:[:row |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9712
	    maskPadded
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9713
		replaceFrom:dstOffs
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9714
		to:(dstOffs+nB-1)
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9715
		with:mask
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9716
		startingAt:srcOffs.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9717
	    dstOffs := dstOffs + bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9718
	    srcOffs := srcOffs + bpl.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9719
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9720
	src := srcPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9721
	mask := maskPadded.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9722
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9723
    ].
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9724
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9725
    src invert.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9726
    1 to:src size do:[:index |
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9727
	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
  9728
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9729
    mask invert.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9730
    cursor := self
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9731
	primCreateCursorSourceBits:src
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9732
	maskBits:mask
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9733
	hotX:hx hotY:hy
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9734
	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
  9735
    cursor notNil ifTrue:[^ cursor ].
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9736
    'WinWorkstation [warning]: could not create bitmap cursor' infoPrintCR.
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9737
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9738
    "Modified: / 08-09-2006 / 15:39:42 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9739
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9740
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9741
cursorBitmapPadding
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9742
    ^ 16 "/ windows requires short-padded rows
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9743
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9744
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9745
destroyCursor:aCursorId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9746
    "destroy a cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9747
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9748
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9749
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9750
    if (ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9751
	if (__isExternalAddress(aCursorId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9752
	    HCURSOR curs = _HCURSORVal(aCursorId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9753
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9754
	    if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9755
#ifdef KEEP_STD_CURSORS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9756
		if ((curs != H_C_ARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9757
		 && (curs != H_C_CROSS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9758
		 && (curs != H_C_IBEAM)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9759
		 && (curs != H_C_ICON)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9760
		 && (curs != H_C_NO)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9761
		 && (curs != H_C_SIZE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9762
		 && (curs != H_C_SIZEALL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9763
		 && (curs != H_C_SIZENESW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9764
		 && (curs != H_C_SIZENS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9765
		 && (curs != H_C_SIZENWSE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9766
		 && (curs != H_C_UPARROW)
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9767
		 && (curs != H_C_APPSTARTING)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9768
		 && (curs != H_C_WAIT))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9769
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9770
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9771
		    DestroyCursor(curs);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9772
#ifdef COUNT_RESOURCES
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9773
		    __cnt_cur--;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9774
		    RESPRINTF(("DestroyCursor %d\n",__cnt_cur));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9775
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9776
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9777
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9778
	    RETURN ( self );
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
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9781
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9782
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9783
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9784
needDeviceFormsForCursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9785
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9786
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9787
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9788
primCreateCursorShapeNr:number
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9789
    " create a standard (shape) cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9790
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  9791
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9792
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9793
    LPCTSTR cId;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9794
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9795
    if (__isSmallInteger(number)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9796
	cId = (LPCTSTR)(__intVal(number));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9797
	newCursor = LoadCursor(NULL, cId);
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  9798
	if (newCursor) {
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  9799
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9800
	    if (cId == IDC_ARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9801
		H_C_ARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9802
	    else if (cId == IDC_CROSS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9803
		H_C_CROSS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9804
	    else if (cId == IDC_IBEAM)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9805
		H_C_IBEAM = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9806
	    else if (cId == IDC_ICON)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9807
		H_C_ICON = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9808
	    else if (cId == IDC_NO)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9809
		H_C_NO = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9810
	    else if (cId == IDC_SIZE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9811
		H_C_SIZE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9812
	    else if (cId == IDC_SIZEALL)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9813
		H_C_SIZEALL = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9814
	    else if (cId == IDC_SIZENESW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9815
		H_C_SIZENESW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9816
	    else if (cId == IDC_SIZENS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9817
		H_C_SIZENS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9818
	    else if (cId == IDC_SIZENWSE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9819
		H_C_SIZENWSE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9820
	    else if (cId == IDC_UPARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9821
		H_C_UPARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9822
	    else if (cId == IDC_WAIT)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9823
		H_C_WAIT = newCursor;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9824
	    else if (cId == IDC_APPSTARTING)
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9825
		H_C_APPSTARTING = newCursor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9826
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9827
	    RETURN ( __MKOBJ(newCursor) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9828
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9829
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9830
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9831
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9832
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9833
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9834
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
  9835
    "create a cursor from given pixels"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9836
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9837
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9838
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9839
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9840
    if (__isByteArray(src)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9841
     && __isByteArray(mask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9842
     && __bothSmallInteger(hx, hy)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9843
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9844
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9845
	newCursor = CreateCursor((HANDLE) __getHInstance(),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9846
				 __intVal(hx), __intVal(hy),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9847
				 __intVal(w), __intVal(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9848
				 __ByteArrayInstPtr(mask)->ba_element,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9849
				 __ByteArrayInstPtr(src)->ba_element);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9850
	if (newCursor) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9851
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9852
	    __cnt_cur++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9853
	    RESPRINTF(("CreateCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9854
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9855
	    RETURN ( __MKOBJ(newCursor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9856
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9857
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9858
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9859
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9860
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9861
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9862
shapeNumberFromSymbol:shape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9863
    "given a shape-symbol, return the corresponding cursor-number,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9864
     or nil if no such standard cursor exists."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9865
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9866
    "this is pure Win-knowlegde - but you may easily add more"
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
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9869
    if (shape == @symbol(upRightHand)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9870
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9871
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9872
    if (shape == @symbol(upLeftArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9873
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9874
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9875
    if (shape == @symbol(upDownArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9876
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENS));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9877
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9878
    if (shape == @symbol(leftRightArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9879
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9880
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9881
    if (shape == @symbol(text)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9882
	RETURN ( __MKSMALLINT( (INT)IDC_IBEAM));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9883
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9884
    if (shape == @symbol(wait)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9885
	RETURN ( __MKSMALLINT( (INT)IDC_WAIT));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9886
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9887
    if (shape == @symbol(crossHair)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9888
	RETURN ( __MKSMALLINT( (INT)IDC_CROSS));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9889
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9890
    if (shape == @symbol(fourWay)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9891
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9892
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9893
    if (shape == @symbol(execute)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9894
	RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9895
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9896
    if (shape == @symbol(noDrop)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9897
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
3110
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9898
    }
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9899
    if (shape == @symbol(stop)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9900
	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
  9901
    }
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9902
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9903
    if (shape == @symbol(IDC_UPARROW)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9904
	RETURN ( __MKSMALLINT( (INT)IDC_UPARROW));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9905
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9906
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9907
    if (shape == @symbol(IDC_SIZE)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9908
	RETURN ( __MKSMALLINT( (INT)IDC_SIZE));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9909
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9910
    if (shape == @symbol(IDC_SIZENWSE)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9911
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENWSE));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9912
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9913
    if (shape == @symbol(IDC_SIZENESW)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9914
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENESW));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9915
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9916
    if (shape == @symbol(IDC_NO)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9917
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9918
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9919
#ifdef IDC_HELP
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9920
    if (shape == @symbol(IDC_HELP)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9921
	RETURN ( __MKSMALLINT( (INT)IDC_HELP));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9922
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9923
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9924
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9925
"/    ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9926
    ^  nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9927
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9928
4461
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9929
!WinWorkstation methodsFor:'drag & drop'!
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9930
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9931
dragFinish:dropHandle
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9932
    "free Win32 data (and remove the drop-file)"
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9933
%{
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9934
    if (__isExternalAddress(dropHandle)) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9935
	HDROP hDrop = (HDROP)__externalAddressVal(dropHandle);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9936
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9937
	__externalAddressVal(dropHandle) = 0;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9938
	if (hDrop) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9939
	    DragFinish(hDrop);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9940
	}
4461
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9941
    }
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9942
%}
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
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9945
!WinWorkstation methodsFor:'drawing'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9946
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9947
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
  9948
		width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9949
    "do a bit-blt; copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9950
     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
  9951
     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
  9952
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9953
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9954
%{
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  9955
    struct gcData *dstGcData = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9956
    struct gcData *srcGcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9957
    HDC srcDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9958
    HDC dstDC = (HDC)0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9959
    int     dstGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9960
    HWND    dstGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9961
    HBITMAP dstGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9962
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9963
    if (! __isExternalAddress(srcGCId)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9964
     || ! __isExternalAddress(dstGCId)) {
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9965
	goto fail;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9966
    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9967
    srcGcData = _GCDATA(srcGCId);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9968
    dstGcData = _GCDATA(dstGCId);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9969
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9970
    if (__bothSmallInteger(w, h)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9971
     && __bothSmallInteger(srcX, srcY)
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9972
     && __bothSmallInteger(dstX, dstY)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9973
     && srcGcData
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9974
     && dstGcData) {
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9975
	int fun = BITBLT_COPY;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9976
	int src_fg, src_bg, dst_fg, dst_bg;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9977
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9978
	fun = dstGcData->bitbltrop2;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9979
#if 0
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9980
	switch (fun) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9981
	  case BITBLT_COPY:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9982
	    console_printf("BITBLT_COPY\n");
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9983
	    break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9984
	  case BITBLT_COPYINVERTED:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9985
	    console_printf("BITBLT_COPYINVERTED\n");
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9986
	    break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9987
	  case BITBLT_XOR:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9988
	    console_printf("BITBLT_XOR\n");
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9989
	    break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9990
	  case BITBLT_AND:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9991
	    console_printf("BITBLT_AND\n");
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9992
	    break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9993
	  case BITBLT_OR:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9994
	    console_printf("BITBLT_OR\n");
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9995
	    break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9996
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9997
#endif
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
	/*
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10000
	 * a scroll operation ?
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
	if (srcGcData->hWnd
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10003
	 && ((srcGcData->hWnd == dstGcData->hWnd)
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10004
	 && (fun == BITBLT_COPY))) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10005
	    RECT rec, updRect;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10006
	    RECT invRec;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10007
	    HRGN updRgn = 0, dstRgn = 0, nUpdRgn = 0;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10008
	    int _srcX = __intVal(srcX);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10009
	    int _srcY = __intVal(srcY);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10010
	    int _dstX = __intVal(dstX);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10011
	    int _dstY = __intVal(dstY);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10012
	    int _w = __intVal(w);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10013
	    int _h = __intVal(h);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10014
	    int noExpose = 0;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10015
	    int _deltaX, _deltaY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10016
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10017
#ifdef CACHE_LAST_DC
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10018
	    if (lastGcData) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10019
		_releaseDC(lastGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10020
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10021
#endif
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
	    rec.left = _srcX;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10024
	    rec.top  = _srcY;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10025
	    rec.right = rec.left + _w;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10026
	    rec.bottom = rec.top + _h;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10027
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10028
	    _deltaX = _dstX - _srcX;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10029
	    _deltaY = _dstY - _srcY;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10030
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10031
	    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
 10032
		    srcGcData->hWnd,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10033
		    _deltaX,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10034
		    _deltaY));
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10035
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10036
	    if ((_deltaX == 0) && (_deltaY == 0)) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10037
		noExpose = 1;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10038
	    } else {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10039
		updRgn = CreateRectRgn(0, 0, 0, 0);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10040
		ScrollWindowEx(srcGcData->hWnd,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10041
			    _deltaX,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10042
			    _deltaY,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10043
			    &rec,            /* area to scroll */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10044
			    0,               /* clip region */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10045
			    updRgn,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10046
			    NULL, /* &invRec, */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10047
			    0 /* SW_ERASE | SW_INVALIDATE */);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10048
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10049
		/*
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10050
		 * we are not interested in the source-area;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10051
		 * only care for exposed areas in the dst area.
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10052
		 */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10053
		dstRgn = CreateRectRgn(_dstX, _dstY, _dstX+_w, _dstY+_h);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10054
		nUpdRgn = CreateRectRgn(0, 0, 0, 0);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10055
		switch (CombineRgn(nUpdRgn, updRgn, dstRgn, RGN_AND)) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10056
		    case ERROR:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10057
			_DeleteObject(nUpdRgn, __LINE__);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10058
			nUpdRgn = updRgn;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10059
			noExpose = 1;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10060
			break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10061
		    case NULLREGION:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10062
			noExpose = 1;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10063
			break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10064
		    default:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10065
			if (__generateExposes(srcGcData->hWnd, nUpdRgn, __WM_GEXPOSE, 1) <= 0) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10066
			    noExpose = 1;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10067
			}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10068
			break;
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
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10071
	    if (noExpose) {
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
		 * no exposes generated - must send a 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
		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
 10076
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10077
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10078
	    if (dstRgn) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10079
		_DeleteObject(dstRgn, __LINE__);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10080
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10081
	    if (nUpdRgn && (nUpdRgn != updRgn)) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10082
		_DeleteObject(nUpdRgn, __LINE__);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10083
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10084
	    if (updRgn) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10085
		_DeleteObject(updRgn, __LINE__);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10086
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10087
	    RETURN ( self );
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
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10090
	fun = dstGcData->bitbltrop2;
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
	if (0 /* fun == BITBLT_COPY */) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10093
	    src_fg = dst_fg = 0xFFFFFF;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10094
	    src_bg = dst_bg = 0x000000;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10095
	} else {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10096
	    src_fg = srcGcData->fgColor;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10097
	    src_bg = srcGcData->bgColor;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10098
	    dst_fg = dstGcData->fgColor;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10099
	    dst_bg = dstGcData->bgColor;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10100
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10101
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
	 * a simple copy (like scroll, but in a bitmap) ?
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
	if ((srcGcData == dstGcData)
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10106
	 && (fun == BITBLT_COPY)) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10107
	    RECT rec, uprec;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10108
	    int _srcX, _srcY;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10109
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10110
	    rec.left = _srcX = __intVal(srcX);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10111
	    rec.top = _srcY = __intVal(srcY);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10112
	    rec.right = rec.left + __intVal(w);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10113
	    rec.bottom = rec.top + __intVal(h);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10114
	    srcDC = _getDC(srcGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10115
	    SetBkColor(srcDC, src_fg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10116
	    SetTextColor(srcDC, src_bg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10117
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10118
	    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
 10119
	    ScrollDC(srcDC, __intVal(dstX)-_srcX,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10120
			    __intVal(dstY)-_srcY,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10121
			    &rec, 0, 0, &uprec);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10122
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10123
	    SetBkColor(srcDC, srcGcData->bgColor);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10124
	    SetTextColor(srcDC, srcGcData->fgColor);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10125
#ifndef CACHE_LAST_DC
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10126
	    _releaseDC(srcGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10127
#endif
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10128
	    RETURN ( self );
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10129
	}
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10130
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10131
#ifdef xxCACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10132
/* mhmh - this should not be needed */
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10133
	if (lastGcData) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10134
	    _releaseDC(lastGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10135
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10136
#endif
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
	if (dstGcData == srcGcData) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10139
	    srcDC = dstDC = _getDC(dstGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10140
	} else {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10141
	    srcDC = _getDC(srcGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10142
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10143
	    /*
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10144
	     * kludge - pretent nothing is cached for a moment,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10145
	     * to avoid release in getDC below ...
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10146
	     */
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10147
#ifdef CACHE_LAST_DC
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10148
	    dstGcOwnerThreadID = lastGcOwnerThreadID;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10149
	    dstGcHWIN = lastGcHWIN;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10150
	    dstGcHBITMAP = lastGcHBITMAP;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10151
	    lastGcData = 0;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10152
#endif
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10153
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10154
	    dstDC = _getDC(dstGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10155
	    SetBkColor(dstDC, dst_fg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10156
	    SetTextColor(dstDC, dst_bg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10157
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10158
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10159
	SetBkColor(srcDC, src_fg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10160
	SetTextColor(srcDC, src_bg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10161
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10162
	CPRINTF(("bitblt src f:%x b:%x",GetTextColor(srcDC),GetBkColor(srcDC)));
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10163
	CPRINTF(("dst f:%x b:%x\n",GetTextColor(dstDC),GetBkColor(dstDC)));
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10164
	if (BitBlt(dstDC,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10165
	     __intVal(dstX), __intVal(dstY),
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10166
	     __intVal(w), __intVal(h),
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10167
	     srcDC,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10168
	     __intVal(srcX), __intVal(srcY),
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10169
	     fun)
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10170
	   == 0
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10171
	  ) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10172
	    console_fprintf(stderr, "WinWorkstation [info]: ERROR in BitBlt: %d\n", GetLastError());
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
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10175
	if (dstGcData != srcGcData) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10176
	    SetBkColor(dstDC, dstGcData->bgColor);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10177
	    SetTextColor(dstDC, dstGcData->fgColor);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10178
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10179
	SetBkColor(srcDC, srcGcData->bgColor);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10180
	SetTextColor(srcDC, srcGcData->fgColor);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10181
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10182
	if (srcGcData != dstGcData) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10183
	    _releaseDC(srcGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10184
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10185
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10186
#ifdef CACHE_LAST_DC
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10187
	/*
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10188
	 * kludge again - restore last-DC cache
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
	lastGcData = dstGcData;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10191
	lastGcOwnerThreadID = dstGcOwnerThreadID;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10192
	lastGcHWIN = dstGcHWIN;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10193
	lastGcHBITMAP = dstGcHBITMAP;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10194
#else
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10195
	_releaseDC(dstGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10196
#endif
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10197
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10198
    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 10199
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10200
 fail: ;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10201
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10202
    self primitiveFailed.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10203
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10204
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10205
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10206
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
 10207
		width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10208
    "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
 10209
     copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10210
     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
 10211
     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
 10212
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10213
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10214
    ^ self
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10215
	copyFromId:sourceId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10216
		 x:srcX y:srcY gc:srcDCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10217
		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
 10218
	     width:w height:h
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10219
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10220
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10221
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
 10222
    "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
 10223
     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
 10224
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10225
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10226
    int __x, __y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10227
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10228
    double f;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10229
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10230
    if (__isSmallInteger(startAngle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10231
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10232
    else if (__isFloat(startAngle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10233
	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
 10234
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
 10235
	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
 10236
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10237
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10238
    if (__isSmallInteger(angle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10239
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10240
    else if (__isFloat(angle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10241
	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
 10242
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
 10243
	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
 10244
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10245
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10246
    if (angle2 <= 0) {
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10247
	RETURN (self);
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10248
    }
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10249
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10250
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10251
     && __bothSmallInteger(x, y)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10252
     && __bothSmallInteger(width, height))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10253
     {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10254
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10255
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10256
	POINT p;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10257
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10258
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10259
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10260
	__x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10261
	__y = __intVal(y);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10262
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10263
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10264
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10265
	if (! GcDataGetPen(hDC, gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10266
	    DPRINTF(("displayArc: no pen\n"));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10267
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10268
	    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
 10269
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10270
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10271
	    yR = h / 2;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10272
	    if (angle2 - angle1 >= 360) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10273
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10274
		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
 10275
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10276
		double sin(), cos();
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10277
		float rad1, rad2;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10278
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10279
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10280
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10281
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10282
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10283
		angle2 = angle1 - angle2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10284
		/* sigh - compute the intersections ... */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10285
		rad1 = (angle1 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10286
		rad2 = (angle2 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10287
		xB = cos(rad1) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10288
		yB = sin(rad1) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10289
		xE = cos(rad2) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10290
		yE = sin(rad2) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10291
		xB = __x + xR - xB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10292
		yB = __y + yR - yB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10293
		xE = __x + xR - xE + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10294
		yE = __y + yR - yE + 0.5;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10295
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10296
	    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
 10297
	    Arc(hDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10298
		__x, __y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10299
		__x + w, __y + h,
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10300
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10301
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10302
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10303
	    GcDataReleasePen(hDC, gcData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10304
	}
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10305
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10306
	_releaseDC(gcData);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10307
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10308
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10309
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10310
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10311
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10312
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10313
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10314
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10315
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
 10316
    "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
 10317
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10318
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10319
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10320
     && __bothSmallInteger(x0, y0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10321
     && __bothSmallInteger(x1, y1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10322
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10323
	int __x1 = __intVal(x1), __y1 = __intVal(y1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10324
	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
 10325
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10326
/*      DPRINTF(("displayLine: %d/%d -> %d/%d\n",
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10327
		    __intVal(x0), __intVal(y0),
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10328
		    __x1, __y1));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10329
*/
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10330
	if (! GcDataGetPen(hDC, gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10331
	    DPRINTF(("displayLine: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10332
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10333
	    MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10334
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10335
	    LineTo(hDC, __x1, __y1);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10336
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10337
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10338
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10339
	     */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10340
	    LineTo(hDC, __x1+1, __y1);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10341
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10342
	    GcDataReleasePen(hDC, gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10343
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10344
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10345
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10346
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10347
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10348
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10349
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10350
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10351
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10352
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
 10353
    "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
 10354
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10355
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10356
    if (__isExternalAddress(aGCId)
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10357
     && __bothSmallInteger(px, py)) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10358
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10359
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10360
	POINT p;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10361
	int __x = __intVal(px), __y = __intVal(py);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10362
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10363
#ifdef OLD
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10364
	int savedLStyle = gcData->lStyle;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10365
	int savedLWidth = gcData->lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10366
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10367
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10368
	 * 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
 10369
	 */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10370
	if ((gcData->lStyle != PS_SOLID)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10371
	 || (gcData->lineWidth > 1)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10372
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10373
	    gcData->lStyle = PS_SOLID;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10374
	    gcData->lineWidth = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10375
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10376
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10377
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10378
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10379
	if (! GcDataGetPen(hDC,gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10380
	    DPRINTF(("displayPoint: no pen\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10381
	} else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10382
	    MoveToEx(hDC, __x, __y, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10383
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10384
	     * end-point ...
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
	    LineTo(hDC, __x+1, __y);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10387
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10388
	    GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10389
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10390
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10391
# ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10392
	_releaseDC(gcData);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10393
# endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10394
	if ((gcData->lStyle != savedLStyle)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10395
	 || (gcData->lineWidth != savedLWidth)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10396
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10397
	    gcData->lStyle = savedLStyle;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10398
	    gcData->lineWidth = savedLWidth;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10399
	}
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10400
#else /* NEW */
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10401
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10402
	hDC = _getDC(gcData);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10403
	SetPixelV(hDC, __x, __y, gcData->fgColor);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10404
# ifndef CACHE_LAST_DC
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10405
	_releaseDC(gcData);
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10406
# endif
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10407
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10408
#endif /* NEW */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10409
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10410
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10411
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10412
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10413
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10414
displayPolygon:aPolygon in:ignoredDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10415
    "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
 10416
     which define the polygon.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10417
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10418
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10419
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10420
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10421
    numberOfPoints := aPolygon size.
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
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10424
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10425
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10426
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10427
    if (__isExternalAddress(aGCId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10428
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10429
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10430
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10431
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10432
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10433
	num = __intVal(numberOfPoints);
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
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10436
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10437
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10438
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10439
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10440
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10441
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10442
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10443
	}
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
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10446
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10447
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10448
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10449
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10450
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10451
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10452
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10453
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10454
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10455
		if (i == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10456
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10457
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10458
		    if (i == (num-1)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10459
			PolylineTo(hDC, &p, 1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10460
		    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10461
			LineTo(hDC, p.x, p.y);
4181
91439783248a bugfix: display polygon PRE_04_JUN_04
ca
parents: 4161
diff changeset
 10462
#ifdef PRE_04_JUN_04
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10463
			/*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10464
			 * end-point ...
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
			LineTo(hDC, p.x+1, p.y);
4181
91439783248a bugfix: display polygon PRE_04_JUN_04
ca
parents: 4161
diff changeset
 10467
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10468
		    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10469
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10470
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10471
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10472
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10473
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10474
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10475
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10476
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10477
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10478
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10479
fail: ;
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
!
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10482
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10483
displayPolylines:aPolyline in:ignoredDrawableId with:aGCId
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10484
    "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
 10485
     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
 10486
     If any coordinate is not integer, an error is triggered."
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10487
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10488
    |numberOfPoints|
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 := aPolyline size.
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
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10493
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10494
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10495
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10496
    if (__isExternalAddress(aGCId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10497
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10498
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10499
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10500
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10501
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10502
	num = __intVal(numberOfPoints);
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
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10505
	    point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10506
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10507
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10508
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10509
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10510
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10511
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10512
	}
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
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10515
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10516
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10517
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10518
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10519
		point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10520
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10521
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10522
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10523
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10524
		if ((i & 1) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10525
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10526
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10527
		    LineTo(hDC, p.x, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10528
		    /*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10529
		     * end-point ...
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
		    LineTo(hDC, p.x+1, p.y);
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
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10534
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10535
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10536
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10537
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10538
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10539
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10540
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10541
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10542
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10543
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10544
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10545
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10546
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
 10547
    "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
 10548
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10549
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10550
    int w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10551
    int xL, yT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10552
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10553
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10554
     && __bothSmallInteger(width, height)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10555
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10556
	HDC hDC = _getDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10557
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10558
	xL = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10559
	yT = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10560
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10561
	h = __intVal(height);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10562
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
 10563
	DDDDPRINTF(("displayRectangle: %d/%d -> %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10564
			xL, yT, w, h));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10565
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10566
	if ((w >= 0) && (h >= 0)) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10567
	    if (! GcDataGetPen(hDC,gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10568
		DPRINTF(("displayRect: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10569
	    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10570
		MoveToEx(hDC, xL, yT, NULL);
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10571
#if 0
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10572
		LineTo(hDC, xL+w, yT);     // to top-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10573
		LineTo(hDC, xL+w, yT+h);   // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10574
		LineTo(hDC, xL, yT+h);     // to bot-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10575
		LineTo(hDC, xL, yT);       // back to top-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10576
#else
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10577
		LineTo(hDC, xL+w, yT);       // to top-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10578
		LineTo(hDC, xL+w, yT+h);     // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10579
		MoveToEx(hDC, xL, yT, NULL); // back to top-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10580
		LineTo(hDC, xL, yT+h);       // to bot-left
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10581
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10582
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10583
		LineTo(hDC, xL+w+1, yT+h);   // move pen one pixel more
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10584
#else
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10585
		LineTo(hDC, xL+w, yT+h);     // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10586
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10587
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10588
#endif
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10589
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10590
		GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10591
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10592
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10593
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10594
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10595
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10596
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10597
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10598
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10599
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10600
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10601
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
 10602
    "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
 10603
     foreground and background characters.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10604
     If the coordinates are not integers, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10605
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10606
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10607
    unsigned char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10608
    OBJ cls;
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
 10609
    int i1, i2, l, n;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10610
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10611
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10612
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10613
     && __isNonNilObject(aString)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10614
     && __bothSmallInteger(index1, index2)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10615
     && __bothSmallInteger(x, y))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10616
    {
6486
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10617
	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
 10618
	int pX, pY;
6486
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10619
	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
 10620
	HFONT hOldFont;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10621
6486
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10622
	i1 = __intVal(index1) - 1;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10623
	i2 = __intVal(index2) - 1;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10624
	if ((i1 < 0) || (i2 < i1)) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10625
	    RETURN (self);
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10626
	}
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10627
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10628
	gcData = _GCDATA(aGCId);
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10629
	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
 10630
	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
 10631
	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
 10632
	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
 10633
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10634
	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
 10635
	    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
 10636
		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
 10637
		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
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10639
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10640
	    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
 10641
		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
 10642
		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
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10644
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10645
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10646
	/* 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
 10647
	 * 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
 10648
	 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10649
	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
 10650
	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
 10651
	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
 10652
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10653
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10654
	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
 10655
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10656
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10657
	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
 10658
6486
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10659
	cp = __stringVal(aString);
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10660
	l = i2 - i1 + 1;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10661
	if (l > 32758) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10662
	    /* 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
 10663
	    l = 32758;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10664
	}
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10665
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10666
	if (__isStringLike(aString)) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10667
	    n = __stringSize(aString);
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
 10668
commonOutChars:
6486
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10669
	    if (i2 < n) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10670
		cp += i1;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10671
		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
 10672
		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
 10673
		    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
 10674
		    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
 10675
		    goto error;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10676
		}
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10677
	    }
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10678
	    goto ret;
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
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10681
	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
 10682
	cp += nInstBytes;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10683
	n = __byteArraySize(aString) - nInstBytes;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10684
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10685
	if (__isBytes(aString)) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10686
	    goto commonOutChars;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10687
	}
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10688
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10689
	/* Unicode */
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10690
	if (__isWords(aString)) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10691
	    n = n / 2;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10692
	    if (i2 < n) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10693
		WIDECHAR *w_cp = (WIDECHAR *)cp;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10694
		w_cp += i1;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10695
		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
 10696
		    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
 10697
		    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
 10698
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10699
		goto ret;
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
	}
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 10702
ret:;
4941
f9fae1143962 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4939
diff changeset
 10703
#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
 10704
	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
 10705
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10706
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10707
	SelectObject(hDC, hOldFont);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10708
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10709
#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
 10710
	_releaseDC(gcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10711
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10712
    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10713
    RETURN (self);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10714
error: ;;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10715
%}.
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 10716
    self textOutFailed.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10717
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10718
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10719
drawBits:imageBits
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10720
    bitsPerPixel:bitsPerPixel
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10721
    depth:imageDepth padding:padd
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10722
    width:imageWidth height:imageHeight
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10723
    x:srcx y:srcy
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10724
    into:ignoredDrawableId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10725
    x:dstx y:dsty
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10726
    width:w height:h
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10727
    with:aGCId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10728
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10729
    "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
 10730
     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
 10731
     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
 10732
     depth and pixel-units to be different (in theory).
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10733
     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
 10734
     depth - otherwise, primitive failure will be signalled.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10735
     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
 10736
     colors are allocated - otherwise the colors may be wrong."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10737
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10738
    (self
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10739
	primDrawBits:imageBits
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10740
	bitsPerPixel:bitsPerPixel
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10741
	depth:imageDepth
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10742
	width:imageWidth height:imageHeight
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10743
	x:srcx y:srcy
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10744
	into:ignoredDrawableId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10745
	x:dstx y:dsty
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10746
	width:w height:h
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10747
	with:aGCId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10748
	parameters:(Array with:nil with:padd with:nil with:nil with:nil)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10749
	"/ 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
 10750
    ) ifFalse:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10751
	"
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10752
	 also happens, if a segmentation violation occurs in primitive code...
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10753
	"
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10754
	self primitiveFailed
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10755
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10756
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10757
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10758
drawBits:imageBits
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10759
    bitsPerPixel:bitsPerPixel
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10760
    depth:imageDepth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10761
    width:imageWidth height:imageHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10762
    x:srcx y:srcy
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10763
    into:ignoredDrawableId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10764
    x:dstx y:dsty
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10765
    width:w height:h
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10766
    with:aGCId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10767
    parameters:parameters
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10768
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10769
    "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
 10770
     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
 10771
     Individual source pixels have bitsPerPixel bits, allowing to draw
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10772
     depth and pixel-units to be different (in theory).
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10773
     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
 10774
     depth - otherwise, primitive failure will be signalled.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10775
     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
 10776
     colors are allocated - otherwise the colors may be wrong."
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10777
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10778
    (self
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10779
	primDrawBits:imageBits
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10780
	bitsPerPixel:bitsPerPixel
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10781
	depth:imageDepth
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10782
	width:imageWidth height:imageHeight
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10783
	x:srcx y:srcy
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10784
	into:ignoredDrawableId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10785
	x:dstx y:dsty
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10786
	width:w height:h
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10787
	with:aGCId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10788
	parameters:parameters
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10789
	"/ 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
 10790
    ) ifFalse:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10791
	"
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10792
	 also happens, if a segmentation violation occurs in primitive code...
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10793
	"
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10794
	self primitiveFailed
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10795
    ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10796
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10797
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10798
fillArcX:x y:y width:width height:height from:startAngle angle:angle
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10799
	       in:ignoredDrawableId with:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10800
    "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
 10801
     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
 10802
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10803
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10804
    int __x, __y, w, h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10805
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10806
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10807
    if (__isSmallInteger(startAngle))
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10808
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10809
    else if (__isFloat(startAngle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10810
	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
 10811
    } else if (__isShortFloat(startAngle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10812
	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
 10813
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10814
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10815
    if (__isSmallInteger(angle))
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10816
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10817
    else if (__isFloat(angle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10818
	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
 10819
    } else if (__isShortFloat(angle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10820
	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
 10821
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10822
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10823
    if (angle2 <= 0) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10824
	RETURN (self);
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10825
    }
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10826
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10827
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10828
     && __bothSmallInteger(x, y)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10829
     && __bothSmallInteger(width, height))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10830
     {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10831
	struct gcData *gcData = _GCDATA(aGCId);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10832
	HDC hDC;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10833
	HBRUSH hBrush;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10834
	HPEN prevPen = 0;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10835
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10836
	w = __intVal(width);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10837
	h = __intVal(height);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10838
	__x = __intVal(x);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10839
	__y = __intVal(y);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10840
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10841
	hDC = _getDC(gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10842
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10843
	hBrush = GcDataGetBrush(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10844
	if (hBrush == 0) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10845
	    DPRINTF(("fillArc: no brush\n"));
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10846
	} else {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10847
	    HPEN hPen = 0;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 10848
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 10849
#if 0
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10850
	    hPen = GcDataGetPen(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10851
	    if (hPen == 0) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10852
		DPRINTF(("fillArc: no pen\n"));
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10853
		goto failpen;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10854
	    }
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10855
#else
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10856
	    prevPen = SelectObject(hDC, __nullPen);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10857
	    w++;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10858
	    h++;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10859
#endif
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10860
	    {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10861
		double xB, yB, xE, yE, xR, yR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10862
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10863
		xR = w / 2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10864
		yR = h / 2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10865
		if (angle2 - angle1 >= 360) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10866
		    xB = xE = __x + xR + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10867
		    yB = yE = __y /*+ yR + 0.5*/;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10868
		} else {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10869
		    double sin(), cos();
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10870
		    float rad1, rad2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10871
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10872
		    if (angle1 <= 180)
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10873
			angle1 = 180 - angle1;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10874
		    else
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10875
			angle1 = 360 + 180 - angle1;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10876
		    angle2 = angle1 - angle2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10877
		    /* sigh - compute the intersections ... */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10878
		    rad1 = (angle1 * 3.14159265359) / 180.0;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10879
		    rad2 = (angle2 * 3.14159265359) / 180.0;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10880
		    xB = cos(rad1) * xR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10881
		    yB = sin(rad1) * yR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10882
		    xE = cos(rad2) * xR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10883
		    yE = sin(rad2) * yR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10884
		    xB = __x + xR - xB + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10885
		    yB = __y + yR - yB + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10886
		    xE = __x + xR - xE + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10887
		    yE = __y + yR - yE + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10888
		}
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10889
		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
 10890
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10891
		Pie(hDC,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10892
		    __x, __y,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10893
		    __x + w + 1, __y + h + 1,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10894
		    (int)xB, (int)yB,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10895
		    (int)xE, (int)yE);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10896
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10897
		if (hPen) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10898
		    GcDataReleasePen(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10899
		}
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10900
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10901
failpen:
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10902
#ifdef CACHE_LAST_CG
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10903
	    if (prevPen) SelectObject(hDC, prevPen);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10904
#endif
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10905
	    GcDataReleaseBrush(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10906
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10907
#ifndef CACHE_LAST_DC
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10908
	_releaseDC(gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10909
#endif
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10910
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10911
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10912
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10913
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10914
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10915
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10916
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10917
fillPolygon:aPolygon in:ignoredDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10918
    "fill a polygon given by its points.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10919
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10920
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10921
    |numberOfPoints|
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 := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10924
    self
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10925
	primFillPolygon:aPolygon n:numberOfPoints
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10926
	in:ignoredDrawableId with:aGCId
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10927
!
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10928
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10929
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
 10930
    "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
 10931
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10932
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10933
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10934
    int w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10935
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10936
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10937
     && __bothSmallInteger(width, height)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10938
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10939
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10940
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10941
	if ((w >= 0) && (h >= 0)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10942
	    struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10943
	    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10944
	    HBRUSH hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10945
	    RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10946
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10947
	    hDC = _getDC(gcData);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10948
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10949
	    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
 10950
	    if (! hBrush) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10951
		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
 10952
	    } else {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10953
		rct.left = __intVal(x);
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10954
		rct.top  = __intVal(y);
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10955
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10956
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10957
		rct.right  = rct.left + w;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10958
		rct.bottom = rct.top  + h;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10959
#else
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10960
		rct.right  = rct.left + w + 1;    /* definitiv ! */
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10961
		rct.bottom = rct.top  + h + 1;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10962
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10963
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10964
		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
 10965
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10966
		/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10967
		 * for solid draws (without function), can use FillRect,
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10968
		 * which is faster and does not need a pen.
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10969
		 */
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10970
		if ((gcData->rop2 == R2_COPYPEN)
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10971
		 && (gcData->bitbltrop2 == BITBLT_COPY)) {
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10972
		    AQUIRE_DRAW_MUTEX
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10973
		    FillRect(hDC, &rct, hBrush);
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10974
		    RELEASE_DRAW_MUTEX
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10975
		    GcDataReleaseBrush(hDC, gcData);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10976
		} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10977
		    HPEN prevPen;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10978
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10979
		    prevPen = SelectObject(hDC, __nullPen);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10980
/* sigh - conflict between ST/X's Rectangle and Win32's Rectangle */
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10981
# undef Rectangle
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10982
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10983
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10984
		    Rectangle(hDC, rct.left, rct.top, rct.right +1, rct.bottom +1);
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10985
#else
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10986
		    Rectangle(hDC, rct.left, rct.top, rct.right, rct.bottom);
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10987
#endif
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10988
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10989
# define Rectangle __DEF_Rectangle
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10990
		    GcDataReleaseBrush(hDC, gcData);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10991
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10992
		    SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10993
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10994
		}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10995
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10996
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10997
	    _releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10998
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10999
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11000
	RETURN ( self );
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
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11003
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11004
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11005
primDrawBits:imageBits
8023
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11006
    bitsPerPixel:bitsPerPixel
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11007
    depth:imageDepth msb:msb
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11008
    masks:maskVector
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11009
    padding:padd
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11010
    extent:imageExtent
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11011
    sourceOrigin:srcOrigin
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11012
    into:ignoredDrawableId
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11013
    destinationOrigin:dstOrigin
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11014
    extent:imageExtent2
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11015
    with:aGCId
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11016
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11017
    (self
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11018
	primDrawBits:imageBits
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11019
	bitsPerPixel:bitsPerPixel
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11020
	depth:imageDepth
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11021
	width:imageExtent x height:imageExtent y
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11022
	x:srcOrigin x y:srcOrigin y
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11023
	into:ignoredDrawableId
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11024
	x:dstOrigin x y:dstOrigin y
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11025
	width:imageExtent x height:imageExtent y
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11026
	with:aGCId
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11027
	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
 11028
	"/ 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
 11029
	"/   sourceAlphaOrNil := params at:1.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11030
	"/   padd := params at:2.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11031
	"/   redMask := params at:3.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11032
	"/   greenMask := params at:4.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11033
	"/   blueMask := params at:5.
8023
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11034
    ) ifFalse:[
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11035
	"
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11036
	 also happens, if a segmentation violation occurs in primitive code...
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11037
	"
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11038
	self primitiveFailed
8023
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11039
    ].
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11040
!
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
primDrawBits:imageBits
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11043
	bitsPerPixel:bitsPerPixel depth:imageDepth
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11044
	width:imageWidth height:imageHeight
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11045
	x:srcx y:srcy
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11046
	into:ignoredDrawableId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11047
	x:dstx y:dsty
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11048
	width:w height:h
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11049
	with:aGCId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11050
	parameters:params
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11051
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11052
    |sourceAlphaOrNil padd redMask greenMask blueMask|
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
    "/ 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
 11055
    sourceAlphaOrNil := params at:1.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11056
    padd := params at:2.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11057
    redMask := params at:3.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11058
    greenMask := params at:4.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11059
    blueMask := params at:5.
8011
6fb515551297 #BUGFIX by expecco
Claus Gittinger <cg@exept.de>
parents: 7991
diff changeset
 11060
6fb515551297 #BUGFIX by expecco
Claus Gittinger <cg@exept.de>
parents: 7991
diff changeset
 11061
%{  /* STACK: 20000 */
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11062
    unsigned char fastBits[10000];
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11063
    unsigned char *b_bits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11064
    unsigned char *allocatedBits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11065
    struct gcData *gcData = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11066
    HDC hDC = (HDC)0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11067
    unsigned char *__imageBits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11068
    int _sourceAlpha = 0;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11069
    int _doAlphaBlend = 0;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11070
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11071
    if (__isByteArray(imageBits)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11072
	__imageBits = __ByteArrayInstPtr(imageBits)->ba_element;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11073
    } else if (__isExternalBytesLike(imageBits)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11074
	__imageBits = (unsigned char *)(__externalBytesAddress(imageBits));
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11075
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11076
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11077
    if (ISCONNECTED
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11078
     && __isExternalAddress(aGCId)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11079
     && __bothSmallInteger(srcx, srcy)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11080
     && __bothSmallInteger(dstx, dsty)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11081
     && __bothSmallInteger(w, h)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11082
     && __bothSmallInteger(imageWidth, imageHeight)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11083
     && __bothSmallInteger(imageDepth, bitsPerPixel)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11084
     && __isSmallInteger(padd)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11085
     && __imageBits)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11086
     {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11087
	struct
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11088
	{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11089
	  BITMAPINFOHEADER bmiHeader;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11090
	  DWORD r;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11091
	  DWORD g;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11092
	  DWORD b;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11093
	  DWORD a;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11094
	} bitmap;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11095
	int _padd = __intVal(padd);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11096
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11097
	gcData = _GCDATA(aGCId);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11098
	if (! gcData )
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11099
	    goto fail;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11100
	hDC = _getDC(gcData);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11101
	DDDDPRINTF(("hDC = %x\n", hDC));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11102
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11103
	if (_padd != WIN32PADDING) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11104
	    int row, col;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11105
	    unsigned char *cp;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11106
	    unsigned char *pBits;
8192
53248c9f370b padding fix
Claus Gittinger <cg@exept.de>
parents: 8173
diff changeset
 11107
	    int b_width, b_height, bytesPerRowST, bytesPerRowWIN, paddingDelta, nBytes;
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11108
	    int bi = __intVal(bitsPerPixel);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11109
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11110
	    b_width = __intVal(imageWidth);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11111
	    b_height = __intVal(imageHeight);
8192
53248c9f370b padding fix
Claus Gittinger <cg@exept.de>
parents: 8173
diff changeset
 11112
53248c9f370b padding fix
Claus Gittinger <cg@exept.de>
parents: 8173
diff changeset
 11113
	    bytesPerRowST = (b_width * bi + (_padd-1)) / _padd * (_padd / 8);
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11114
	    bytesPerRowWIN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8);
8192
53248c9f370b padding fix
Claus Gittinger <cg@exept.de>
parents: 8173
diff changeset
 11115
	    paddingDelta = bytesPerRowWIN - bytesPerRowST;
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11116
	    /* console_printf("padd %d bs %d bw %d p %d\n",_padd,bytesPerRowST,bytesPerRowWN,padding); */
8192
53248c9f370b padding fix
Claus Gittinger <cg@exept.de>
parents: 8173
diff changeset
 11117
	    if (paddingDelta != 0) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11118
		nBytes = b_height * bytesPerRowWIN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11119
		if (nBytes < sizeof(fastBits)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11120
		    cp = b_bits = fastBits;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11121
		} else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11122
		    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11123
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11124
		if (cp) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11125
		    pBits = __imageBits;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11126
		    for (row = b_height; row; row--) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11127
			for (col = bytesPerRowST; col; col--) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11128
			    *cp++ = *pBits++;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11129
			}
8192
53248c9f370b padding fix
Claus Gittinger <cg@exept.de>
parents: 8173
diff changeset
 11130
			cp += paddingDelta;
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11131
		    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11132
		} else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11133
		    goto fail;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11134
	    }
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
	if (b_bits == 0) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11138
	    b_bits = __imageBits;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11139
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11140
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11141
	bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11142
	bitmap.bmiHeader.biPlanes = 1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11143
	switch (__intVal(imageDepth)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11144
	    case 16:
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11145
		// BI_BITFIELDS is only possible with 16 and 32 bit images
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11146
		// (see msdn.microoft.com/library/cc250415.aspx)
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11147
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11148
		// notice the default r/g/b (STX order here)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11149
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11150
		bitmap.r = redMask == nil ? 0xf800 : __intVal(redMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11151
		bitmap.g = greenMask == nil ? 0x07e0 : __intVal(greenMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11152
		bitmap.b = blueMask == nil ? 0x001f : __intVal(blueMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11153
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11154
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11155
	    case 24:
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11156
		// BI_BITFIELDS is only possible with 16 and 32 bit images
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11157
		// (see msdn.microoft.com/library/cc250415.aspx)
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11158
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11159
		// notice the default b/g/r (WIN32 order here)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11160
		bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11161
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11162
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11163
	    case 32:
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11164
		// BI_BITFIELDS is only possible with 16 and 32 bit images
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11165
		// (see msdn.microoft.com/library/cc250415.aspx)
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11166
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11167
		// notice the default r/g/b (STX order here)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11168
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11169
		bitmap.r = redMask == nil ? 0x0000ff : __intVal(redMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11170
		bitmap.g = greenMask == nil ? 0x00ff00 : __intVal(greenMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11171
		bitmap.b = blueMask == nil ? 0xff0000 : __intVal(blueMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11172
		bitmap.a = 0xff000000;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11173
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11174
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11175
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11176
	if (sourceAlphaOrNil != nil) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11177
	    DPRINTF(("sourceAlphaOrNil = %x\n", sourceAlphaOrNil));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11178
	    _sourceAlpha = __intVal(sourceAlphaOrNil);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11179
	    _doAlphaBlend = 1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11180
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11181
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11182
	bitmap.bmiHeader.biSizeImage = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11183
	bitmap.bmiHeader.biXPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11184
	bitmap.bmiHeader.biYPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11185
	bitmap.bmiHeader.biClrUsed = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11186
	bitmap.bmiHeader.biClrImportant = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11187
	bitmap.bmiHeader.biWidth = __intVal(imageWidth);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11188
	bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11189
	bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11190
	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
 11191
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11192
	if (! _doAlphaBlend) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11193
	    // normal draw (no alpha)
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11194
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11195
	    SetDIBitsToDevice(hDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11196
				__intVal(dstx), __intVal(dsty),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11197
				__intVal(w), __intVal(h),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11198
				__intVal(srcx), __intVal(srcy),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11199
				0, __intVal(h),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11200
				(void *)b_bits,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11201
				(BITMAPINFO*)&bitmap,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11202
				DIB_RGB_COLORS);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11203
	} else {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11204
	    // alpha blending
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11205
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11206
	    HDC ahdc;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11207
	    HBITMAP ahbitmap;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11208
	    void *pvBits;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11209
	    BLENDFUNCTION bf;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11210
	    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
 11211
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11212
	    if (P_AlphaBlend == 0) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11213
		/* as I don't have AlphaBlend in the inport32.lib (bcc sucks),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11214
		 * fetch its address dynamically...
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11215
		 */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11216
		HINSTANCE hWinGDI = LoadLibrary("msimg32.dll");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11217
		if (hWinGDI) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11218
		    P_AlphaBlend = (BOOL (__stdcall *)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION ))
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11219
					GetProcAddress(hWinGDI, "AlphaBlend");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11220
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11221
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11222
	    if (P_AlphaBlend != 0) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11223
		DPRINTF(("***********************************\n"));
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11224
		DPRINTF(("_sourceAlpha = %d\n", _sourceAlpha));
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11225
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11226
		ahdc = CreateCompatibleDC(hDC);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11227
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11228
		ahbitmap = CreateCompatibleBitmap(hDC, __intVal(imageWidth), __intVal(imageHeight));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11229
		SelectObject(ahdc, ahbitmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11230
		SetDIBitsToDevice(ahdc,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11231
				0, 0,    /* dstx, dsty */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11232
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11233
				__intVal(srcx), __intVal(srcy),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11234
				0, __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11235
				(void *)b_bits,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11236
				(BITMAPINFO*)&bitmap,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11237
				DIB_RGB_COLORS);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11238
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11239
		bf.BlendOp = AC_SRC_OVER;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11240
		bf.BlendFlags = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11241
		bf.SourceConstantAlpha = _sourceAlpha;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11242
		bf.AlphaFormat = AC_SRC_ALPHA;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11243
#if 1
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11244
		(*P_AlphaBlend) (hDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11245
				__intVal(dstx), __intVal(dsty),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11246
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11247
				ahdc,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11248
				0, 0,     /* srcx, srcy */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11249
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11250
				bf);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11251
#else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11252
		bf.SourceConstantAlpha = 255-_sourceAlpha;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11253
		bf.AlphaFormat = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11254
		bf.BlendOp = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11255
		(*P_AlphaBlend) (ahdc,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11256
				0, 0,     /* dstx, dsty */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11257
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11258
				hDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11259
				__intVal(dstx), __intVal(dsty),   /* srcx, srcy */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11260
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11261
				bf);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11262
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11263
		BitBlt (hDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11264
				__intVal(dstx), __intVal(dsty),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11265
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11266
				ahdc,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11267
				0, 0,   /* srcx, srcy */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11268
				SRCCOPY);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11269
#endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11270
		DeleteObject(ahbitmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11271
		DeleteDC(ahdc);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11272
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11273
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11274
	if (allocatedBits) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11275
	    free(allocatedBits);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11276
	}
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11277
#ifndef CACHE_LAST_DC
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11278
	_releaseDC(gcData);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11279
#endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11280
	RETURN ( true );
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11281
    }
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
fail: ;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11284
    PRINTF(("create temp bitmap FAILED!!!\n"));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11285
    if (allocatedBits) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11286
	PRINTF(("freeing up temp bitmap bits ...\n"));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11287
	free(allocatedBits);
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11288
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11289
#ifndef CACHE_LAST_DC
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11290
    if (hDC) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11291
	_releaseDC(gcData);
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11292
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11293
#endif
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11294
%}
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
    ^ false
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11297
!
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11298
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 11299
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
 11300
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11301
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11302
    OBJ point, px, py;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11303
    int i, num;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11304
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11305
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11306
     && __isSmallInteger(numberOfPoints)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11307
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11308
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11309
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 11310
	HBRUSH hBrush;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11311
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11312
	num = __intVal(numberOfPoints);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11313
	if (num < 3) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11314
	    RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11315
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11316
	for (i=0; i<num; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11317
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11318
	    if (! __isPoint(point)) goto fail;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11319
	    px = _point_X(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11320
	    py = _point_Y(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11321
	    if (! __bothSmallInteger(px, py))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11322
		goto fail;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11323
	}
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11324
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11325
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11326
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 11327
	hBrush = GcDataGetBrush(hDC,gcData);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 11328
	if (hBrush == 0) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11329
	    DPRINTF(("fillPolygon: no brush\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11330
	} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11331
	    HPEN prevPen;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11332
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11333
	    prevPen = SelectObject(hDC, __nullPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11334
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11335
	    BeginPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11336
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11337
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11338
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11339
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11340
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11341
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11342
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11343
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11344
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11345
			p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11346
			p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11347
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11348
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11349
			LineTo(hDC, __intVal(px), __intVal(py));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11350
		    }
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
	    }
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11353
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11354
	    EndPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11355
	    FillPath(hDC);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11356
	    GcDataReleaseBrush(hDC, gcData);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11357
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11358
	    SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11359
#endif
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11360
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11361
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11362
	_releaseDC(gcData);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11363
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11364
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11365
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11366
fail: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11367
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11368
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11369
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11370
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11371
!WinWorkstation methodsFor:'event forwarding'!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11372
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11373
activate:aBoolean view:aView
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11374
    "some view was activated/deactivated.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11375
     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
 11376
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11377
    aBoolean ifFalse:[
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11378
	activeView == aView ifTrue:[
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11379
	    activeView := nil.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11380
	].
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11381
	self focusOutView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11382
    ] ifTrue:[
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11383
	activeView := aView.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11384
	self focusInView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11385
    ].
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
    "Created: / 28.4.1999 / 14:51:51 / cg"
2599
9c0749ee47ed #activate:view: via sensor
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
 11388
    "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
 11389
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11390
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11391
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
 11392
    "forward a configure for some view"
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11393
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11394
    aView realized ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11395
	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
 11396
    ]
4577
3df3646d702f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4576
diff changeset
 11397
3df3646d702f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4576
diff changeset
 11398
    "Modified: / 08-09-2006 / 19:40:18 / cg"
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11399
!
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11400
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11401
copyDataEvent:parameter eventData:dataBytes view:aView
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11402
    "forward a copyData event for some view as a client message"
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11403
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11404
    aView isNil ifTrue:[
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11405
	"/ event arrived, after I destroyed it myself
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11406
	^ self
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11407
    ].
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11408
    aView sensor
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11409
	copyDataEvent:parameter
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11410
	eventData:dataBytes
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11411
	view:aView
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11412
!
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11413
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11414
displayChange
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11415
    "the display metrics/settings have changed.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11416
     This is a speciality of windows.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11417
     TODO: Tell the viewStyle to update itself,
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11418
	   and tell all views to reinit their style.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11419
     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
 11420
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11421
    self initializeVariableScreenProperties.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11422
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11423
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11424
dropFiles:files view:view position:dropPosition handle:dropHandle
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11425
    "called when files are dropped from windows.
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11426
     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
 11427
     eventually"
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11428
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11429
"/    Transcript showCR:'Drop files:'.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11430
"/    Transcript show:'  View:'; showCR:view.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11431
"/    Transcript show:'  Position:'; showCR:dropPosition.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11432
"/    Transcript showCR:'  Files:'.
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11433
"/    files do:[:f|
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11434
"/        Transcript showCR:('    ', f printString)
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11435
"/    ].
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
    view isNil ifTrue:[
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11438
	"/ event arrived, after I destroyed it myself
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11439
	^ self
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11440
    ].
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11441
    view sensor
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11442
	dropFiles:files view:view position:dropPosition handle:dropHandle
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11443
!
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11444
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11445
fontChange
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11446
    "the system fonts (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11447
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11448
     TODO: Tell the viewStyle to update itself,
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 11449
	   and tell all views to reinit their style.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11450
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11451
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11452
    IgnoreFontChanges ~~ true ifTrue:[
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11453
"/        'WinWorkstation [info]: fontChange ignored for now.' infoPrintCR
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11454
    ]
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11455
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11456
    "Modified: / 19.5.1999 / 23:37:17 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11457
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11458
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11459
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
 11460
    "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
 11461
     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
 11462
     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
 11463
     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
 11464
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11465
    |wg screenPoint targetView|
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11466
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11467
    aView isNil ifTrue:[
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11468
	"/ event arrived, after I destroyed it myself
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11469
	^ self
6590
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11470
    ].
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
    UserPreferences current mouseWheelFocusFollowsMouse ifTrue:[
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11473
	screenPoint := self translatePointToRoot:(x@y) fromView:aView.
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11474
	targetView := self viewFromPoint:screenPoint.
6590
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11475
    ].
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
    (targetView isNil) ifTrue:[
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11478
	(wg := aView windowGroup) notNil ifTrue:[
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11479
	    targetView := wg focusView.
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11480
	].
6590
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11481
    ].
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11482
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11483
    aView sensor
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11484
	mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11485
	view:(targetView ? aView)
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11486
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11487
    "Modified: / 21.5.1999 / 13:05:53 / cg"
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11488
!
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11489
4230
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11490
nativeWidgetCommand:commandId view:aView
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11491
    "forward a command event for some view.
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11492
     (Button, CheckBox etc.)"
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11493
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11494
    |sensor|
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11495
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11496
    aView isNil ifTrue:[
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11497
	"/ event arrived, after I destroyed it myself
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11498
	^ self
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11499
    ].
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11500
    sensor := aView sensor.
4249
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11501
    sensor
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11502
	nativeWidgetCommand:#'win32nativeWMCommand:'
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11503
	arguments:(Array with:commandId)
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11504
	view:aView
4230
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11505
!
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11506
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11507
queryEndSession
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11508
    "system is about to be shut down.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11509
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11510
     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
 11511
     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
 11512
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11513
    '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
 11514
    ^ true
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11515
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11516
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11517
settingsChange
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11518
    "some system settings (users preferences) have changed.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11519
     This is a speciality of windows.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11520
     For now, only a few attributes are reinitialized."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11521
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11522
    self initializeVariableSettingsProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11523
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11524
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11525
systemColorChange:aWindow
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11526
    "the system colors (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11527
     This is a speciality of windows.
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11528
     Tell the viewStyle to update itself,
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
 11529
     and tell all view to reinit its style.
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
 11530
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
 11531
     The argument, aWindow is not used."
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11532
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
 11533
    |anyChange|
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
 11534
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 11535
    IgnoreSysColorChanges ifFalse:[
7452
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11536
	"/ 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
 11537
	"/ we are interested in
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11538
	"/ (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
 11539
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11540
	anyChange := false.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11541
	SystemColorValues synchronized:[
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11542
	    SystemColorValues copy keysAndValuesDo:[:eachKey :eachOldColor|
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11543
		|newColor|
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11544
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11545
		newColor := self primGetSystemColor:eachKey.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11546
		newColor ~= eachOldColor ifTrue:[
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11547
		    SystemColorValues at:eachKey put:newColor.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11548
		    anyChange := true.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11549
		].
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
	    anyChange ifTrue:[
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11552
		SimpleView readStyleSheetAndUpdateAllStyleCaches.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11553
		"/ TODO: this should go through the sensor ...
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11554
		"/ ...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
 11555
		self allViewsDo:[:eachView| eachView reinitStyle].
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11556
	    ].
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11557
	].
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11558
    ]
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11559
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 11560
    "
7452
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11561
	Display systemColorChange:nil
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 11562
    "
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11563
!
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11564
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11565
trayAction:eventCode view:aView
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 11566
    "forward a tray event for some view."
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11567
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11568
    |sensor message arg|
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11569
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11570
    aView isNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11571
	"/ event arrived, after I destroyed it myself
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11572
	^ self
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11573
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11574
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11575
    eventCode == 512 "WM_MOUSEMOVE" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11576
	"/ mouse motion
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11577
	message := #trayMouseMotion
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11578
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11579
    eventCode == 513 "WM_LBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11580
	"/ left-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11581
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11582
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11583
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11584
    eventCode == 514 "WM_LBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11585
	"/ left-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11586
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11587
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11588
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11589
    eventCode == 515 "WM_LBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11590
	"/ left-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11591
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11592
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11593
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11594
    eventCode == 516 "WM_RBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11595
	"/ right-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11596
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11597
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11598
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11599
    eventCode == 517 "WM_RBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11600
	"/ right-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11601
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11602
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11603
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11604
    eventCode == 518 "WM_RBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11605
	"/ left-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11606
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11607
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11608
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11609
    eventCode == 519 "WM_MBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11610
	"/ middle-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11611
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11612
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11613
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11614
    eventCode == 520 "WM_MBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11615
	"/ middle-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11616
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11617
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11618
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11619
    eventCode == 521 "WM_MBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11620
	"/ middle-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11621
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11622
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11623
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11624
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11625
    message isNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11626
	Transcript showCR:eventCode.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11627
	^ self.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11628
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11629
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11630
    sensor := aView sensor.
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11631
    sensor
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11632
	trayAction:message
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11633
	arguments:(Array with:arg)
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11634
	view:aView
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11635
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11636
    "Created: / 31-10-2007 / 00:13:31 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 11637
    "Modified: / 05-11-2007 / 12:14:28 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11638
! !
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11639
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11640
!WinWorkstation methodsFor:'event forwarding-native'!
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11641
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11642
win32NativeScroll:scrollCode position:newPos view:aScrollBar
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11643
    "native scrollbar widget event."
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11644
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11645
    aScrollBar isNil ifTrue:[
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11646
	"/ event arrived, after I destroyed it myself
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11647
	^ self
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11648
    ].
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11649
4248
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11650
    self class debugNative ifTrue:[
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11651
	'WinWorkstation [info]: native scroll event' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11652
	    ' code=' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11653
	    scrollCode infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11654
	    ' position=' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11655
	    newPos infoPrintCR.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11656
    ].
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11657
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11658
    aScrollBar sensor
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11659
	nativeWidgetCommand:#win32NativeScroll:position:
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11660
	arguments:(Array with:scrollCode with:newPos) view:aScrollBar
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11661
! !
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11662
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11663
!WinWorkstation methodsFor:'event handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11664
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11665
dispatchEventFor:aViewIdOrNil withMask:eventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11666
    "central event handling method:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11667
     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
 11668
     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
 11669
     otherwise only events for the view with given id are processed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11670
     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
 11671
     handled.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11672
     WARNING: this may block to wait for an event - you better check for a
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11673
              pending event before calling this."
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11674
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11675
    (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11676
        AbortOperationRequest handle:[:ex |
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11677
            ex return
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11678
        ] do:[
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11679
            self dispatchLastEvent.
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11680
        ]
2232
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
    "Modified: 19.8.1997 / 17:10:42 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11684
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11685
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11686
dispatchExposeEventFor:aViewIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11687
    "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
 11688
     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
 11689
     otherwise only events for the view with given id are processed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11690
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11691
    self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11692
!
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
dispatchLastEvent
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11695
    |theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 11696
     eventType hotkeyId|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11697
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11698
%{  /* xxSTACK: 8000 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11699
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11700
    struct queuedEvent _ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11701
    struct inlineCache *ipS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11702
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11703
    static struct inlineCache vid = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11704
    static struct inlineCache conf = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11705
    static struct inlineCache skp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11706
    static struct inlineCache skr = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11707
    static struct inlineCache exp = _ILC5;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11708
    static struct inlineCache gexpS = _ILC6;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11709
    static struct inlineCache nexpS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11710
    static struct inlineCache clr = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11711
    static struct inlineCache bp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11712
    static struct inlineCache br = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11713
    static struct inlineCache bmp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11714
    static struct inlineCache bsp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11715
    static struct inlineCache mot = _ILC4;
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 11716
    static struct inlineCache mwh = _ILC6;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11717
    static struct inlineCache unmap = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11718
    static struct inlineCache map = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11719
    static struct inlineCache termS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11720
    static struct inlineCache destr = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11721
    static struct inlineCache setCurs = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11722
    static struct inlineCache focOut = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11723
    static struct inlineCache focIn = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11724
    static struct inlineCache act = _ILC2;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11725
    static struct inlineCache pe = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11726
    static struct inlineCache pl = _ILC2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11727
    static struct inlineCache vis = _ILC1;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 11728
    static struct inlineCache sysClrChg = _ILC1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11729
    static struct inlineCache fontChg = _ILC0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 11730
    static struct inlineCache settingChg = _ILC0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11731
    static struct inlineCache qEndSess = _ILC0;
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 11732
    static struct inlineCache power = _ILC0;
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 11733
    static struct inlineCache quit = _ILC0;
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 11734
    static struct inlineCache command = _ILC2;
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11735
    static struct inlineCache trayMessage = _ILC2;
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11736
    static struct inlineCache win32NativeScroll = _ILC3;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 11737
    static struct inlineCache win32DrawItem = _ILC2;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11738
    static struct inlineCache copyData = _ILC3;
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11739
    static struct inlineCache dropFiles = _ILC4;
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 11740
    static struct inlineCache hkp = _ILC3;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11741
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11742
    int x, y, w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11743
    int keyCode, modifiers, isDoubleClick = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11744
    int isDown = 1;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11745
    int state, dir;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11746
    OBJ upDown;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11747
    OBJ eB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11748
    char nameBuffer[100];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11749
    HWND hWnd = 0;
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 11750
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 11751
    DDDPRINTF(("dispatchLast\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11752
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11753
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11754
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11755
    if (__isByteArray(eB)) {
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11756
        ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11757
    } else {
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11758
        console_fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11759
        RETURN (false);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11760
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11761
    if (ev) {
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11762
        _ev_buf = *ev;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11763
        ev = &_ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11764
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11765
    hWnd = ev->ev_hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11766
    if (!(hWnd /*&& IsWindow(hWnd)*/)) {
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11767
        DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11768
        RETURN (false);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11769
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11770
    {
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11771
        OBJ t = __INST(lastId);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11772
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11773
        /*
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11774
         * very often, its another event for the same view ...
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11775
         * avoid creation & lookup then.
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11776
         */
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11777
        if (__isExternalAddress(t) && _HWNDVal(t) == hWnd) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11778
            theView = __INST(lastView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11779
            if (__isNonNilObject(theView) && __qClass(theView) == nil) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11780
                theView = nil;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11781
            }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11782
        }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11783
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11784
        if (theView == nil) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11785
            windowID = __MKOBJ(ev->ev_hWnd);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11786
            theView = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, windowID);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11787
        }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11788
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11789
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11790
    if (theView == nil) {
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11791
        DPRINTF(("nil view [hWnd=%x msg=0x%x] in dispatchEvent\n",
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11792
                 ev->ev_hWnd, ev->ev_message));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11793
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11794
        RETURN (false);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11795
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11796
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11797
    switch (ev->ev_message) {
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11798
            DPRINTFIF((__debug_WM_ALL__) , ("message=%d 0x%x wparam=%"_lx_" hwnd=%"_lx_" arg1=%"_lx_")\n",
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11799
                        ev->ev_message, ev->ev_message, (INT)(ev->ev_wParam), (INT)(ev->ev_hWnd), (INT)(ev->ev_arg1)));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11800
            case WM_WINDOWPOSCHANGED:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11801
                {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11802
                    RECT rct;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11803
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11804
                    x = ev->ev_x;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11805
                    y = ev->ev_y;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11806
                    w = ev->ev_w;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11807
                    h = ev->ev_h;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11808
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11809
                    DPRINTF((">>> WM_WINDOWPOSCHANGED -> configure %d/%d , %d/%d\n", x,y,w,h));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11810
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11811
                    (*conf.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11812
                                     @symbol(configureX:y:width:height:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11813
                                     nil, &conf,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11814
                                     __MKSMALLINT(x),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11815
                                     __MKSMALLINT(y),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11816
                                     __MKSMALLINT(w),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11817
                                     __MKSMALLINT(h),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11818
                                     theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11819
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11820
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11821
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11822
            case WM_DROPFILES:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11823
                {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11824
                    HDROP hDrop = (HDROP) ev->ev_wParam;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11825
                    int   count = DragQueryFile( hDrop,0xffffffff,0,0 );
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11826
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11827
                    DPRINTFIF((__debug_WM_DROPFILES__ | __debug_WM_ALL__) , ("count=%d hDrop=%x\n", count, hDrop));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11828
                    if (count > 0) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11829
                        OBJ  dropHandle, files, position;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11830
                        char buf[MAXPATH];
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11831
                        int  i;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11832
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11833
                        dropHandle = __MKOBJ(hDrop);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11834
                        __PROTECT__(dropHandle);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11835
                        files = __ARRAY_NEW_INT( count );
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11836
                        __UNPROTECT__(dropHandle);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11837
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11838
                        for (i = 0;i < count;i++) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11839
                            OBJ s;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11840
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11841
                            DragQueryFile(hDrop,i,buf,sizeof(buf));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11842
                            __PROTECT__(dropHandle);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11843
                            __PROTECT__(files);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11844
                            s = __MKSTRING(buf);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11845
                            __UNPROTECT__(files);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11846
                            __UNPROTECT__(dropHandle);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11847
                            __ArrayInstPtr(files)->a_element[i] = s; __STORE(files, s);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11848
                        }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11849
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11850
                        {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11851
                            POINT pos;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11852
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11853
                            DragQueryPoint(hDrop, &pos);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11854
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11855
                            __PROTECT__(dropHandle);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11856
                            __PROTECT__(files);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11857
                            position = __MKPOINT_INT(pos.x, pos.y);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11858
                            __UNPROTECT__(files);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11859
                            __UNPROTECT__(dropHandle);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11860
                        }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11861
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11862
                        (*dropFiles.ilc_func)
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11863
                            ( self
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11864
                              , @symbol(dropFiles:view:position:handle:)
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11865
                              , nil, &dropFiles,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11866
                              files, theView, position, dropHandle
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11867
                            );
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11868
                    }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11869
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11870
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11871
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11872
            case WM_SHOWWINDOW:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11873
                if (ev->ev_wParam == TRUE) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11874
                    DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11875
                    arg = @symbol(unobscured);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11876
                    (*vis.ilc_func)(theView,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11877
                                    @symbol(visibilityChange:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11878
                                    nil, &vis, arg);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11879
                    (*map.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11880
                                    @symbol(mappedView:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11881
                                    nil, &map, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11882
                } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11883
                    DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11884
#if 0
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11885
                    arg = @symbol(fullyObscured);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11886
                    (*vis.ilc_func)(theView,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11887
                                    @symbol(visibilityChange:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11888
                                    nil, &vis, arg);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11889
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11890
                    (*unmap.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11891
                                      @symbol(unmappedView:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11892
                                      nil, &unmap, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11893
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11894
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11895
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11896
            case __WM_ICONIFIED:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11897
                if (ev->ev_wParam) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11898
                    DPRINTF((">>> __WM_ICONIFIED -> unMappedView:\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11899
#if 0
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11900
                    arg = @symbol(fullyObscured);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11901
                    (*vis.ilc_func)(theView,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11902
                                    @symbol(visibilityChange:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11903
                                    nil, &vis, arg);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11904
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11905
                    (*unmap.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11906
                                      @symbol(unmappedView:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11907
                                      nil, &unmap, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11908
                } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11909
                    DPRINTF((">>> __WM_DEICONIFIED -> mappedView:\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11910
                    arg = @symbol(unobscured);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11911
                    (*vis.ilc_func)(theView,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11912
                                    @symbol(visibilityChange:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11913
                                    nil, &vis, arg);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11914
                    (*map.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11915
                                    @symbol(mappedView:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11916
                                    nil, &map, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11917
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11918
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11919
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11920
            case WM_CLOSE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11921
                DPRINTF((">>> WM_CLOSE -> terminateView:\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11922
                (*termS.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11923
                                  @symbol(terminateView:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11924
                                  nil, &termS, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11925
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11926
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11927
            case WM_DESTROY:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11928
                DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11929
                (*destr.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11930
                                  @symbol(destroyedView:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11931
                                  nil, &destr, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11932
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11933
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11934
            case WM_ACTIVATE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11935
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11936
                switch (LOWORD(ev->ev_wParam)) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11937
                    case WA_INACTIVE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11938
                        DPRINTF((">>> WM_ACTIVATE inactive h=%x\n", ev->ev_hWnd));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11939
                        (*act.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11940
                                        @symbol(activate:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11941
                                        nil, &act,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11942
                                        false, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11943
                        break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11944
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11945
                    case WA_ACTIVE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11946
                    case WA_CLICKACTIVE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11947
                        DPRINTF((">>> WM_ACTIVATE active h=%x\n", ev->ev_hWnd));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11948
                        (*act.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11949
                                        @symbol(activate:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11950
                                        nil, &act,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11951
                                        true, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11952
                        break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11953
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11954
                    default:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11955
                        break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11956
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11957
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11958
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11959
            case WM_MOUSEACTIVATE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11960
                if (__debug_WM_MOUSEACTIVATE__ | __debug_WM_ALL__) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11961
                    PRINTF((">>> WM_MOUSEACTIVATE h=%x -> focusInView:\n", ev->ev_hWnd));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11962
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11963
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11964
                (*focIn.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11965
                                  @symbol(focusInView:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11966
                                  nil, &focIn, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11967
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11968
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11969
            case WM_SETFOCUS:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11970
                DPRINTFIF(__debug_WM_FOCUS__ , (">>> WM_SETFOCUS h=%x -> focusInView:\n", ev->ev_hWnd));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11971
                (*focIn.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11972
                                  @symbol(focusInView:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11973
                                  nil, &focIn, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11974
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11975
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11976
            case WM_KILLFOCUS:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11977
                DPRINTFIF(__debug_WM_FOCUS__ , (">>> WM_KILLFOCUS h=%x -> focusOutOfView\n", ev->ev_hWnd));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11978
                (*focOut.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11979
                                   @symbol(focusOutView:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11980
                                   nil, &focOut, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11981
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11982
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11983
            case __WM_GEXPOSE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11984
                x = ev->ev_x;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11985
                y = ev->ev_y;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11986
                w = ev->ev_w;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11987
                h = ev->ev_h;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11988
                DPRINTF((">>> __WM_GEXPOSE -> gExpose %d/%d -> %d/%d\n", x, y, w, h));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11989
#if 0
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11990
                if (GetWindow_unmapping(hWnd)) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11991
                    console_fprintf(stderr, "oops - __WM_GEXPOSE for unmapping\n");
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11992
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11993
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11994
                (*gexpS.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11995
                                  @symbol(graphicsExposeX:y:width:height:final:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11996
                                  nil, &gexpS,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11997
                                  __MKSMALLINT(x),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11998
                                  __MKSMALLINT(y),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 11999
                                  __MKSMALLINT(w),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12000
                                  __MKSMALLINT(h),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12001
                                  ev->ev_wParam ? true : false,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12002
                                  theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12003
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12004
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12005
            case __WM_NOGEXPOSE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12006
                DPRINTFIF((__debug_WM_EXPOSE__ | __debug_WM_ALL__), (">>> __WM_NOGEXPOSE -> noExpose\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12007
#if 0
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12008
                if (GetWindow_unmapping(hWnd)) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12009
                    console_fprintf(stderr, "oops - __WM_NOGEXPOSE for unmapping\n");
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12010
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12011
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12012
                 (*nexpS.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12013
                                   @symbol(noExposeView:), nil, &nexpS,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12014
                                   theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12015
                break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12016
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 12017
# ifdef LATE_GENERATE_EXPOSE
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12018
            case __WM_PAINT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12019
                {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12020
                    PAINTSTRUCT ps;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12021
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12022
                    AQUIRE_DRAW_MUTEX
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12023
                    __generateExposes(hWnd, NULL, WM_PAINT, 0);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12024
                    RELEASE_DRAW_MUTEX
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12025
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 12026
# if 0
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12027
                    BeginPaint(hWnd, &ps);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12028
                    EndPaint(hWnd, &ps);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12029
# endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12030
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12031
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12032
# endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12033
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12034
            case WM_PAINT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12035
                x = ev->ev_x;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12036
                y = ev->ev_y;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12037
                w = ev->ev_w;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12038
                h = ev->ev_h;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12039
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12040
#if 0
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12041
                if (GetWindow_unmapping(hWnd)) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12042
                    console_fprintf(stderr, "oops - WM_PAINT for unmapping\n");
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12043
                }
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 12044
#endif
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12045
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12046
#ifndef PRE_21_NOV
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12047
                __clearWindow(hWnd, x, y, w, h);
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12048
#else
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12049
# if WM_PAINT_CLEAR_LATE
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12050
                __clearWindow(hWnd, x, y, w, h);
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12051
# endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12052
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12053
#endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12054
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 12055
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS2
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12056
                {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12057
                    HDC hDC;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12058
                    HBRUSH hBrush;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12059
                    RECT rect;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12060
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12061
                    hBrush = CreateSolidBrush(BlackPixel);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12062
                    hDC = GetWindowDC(hWnd);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12063
                    SelectClipRgn(hDC, NULL);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12064
                    rect.left = x;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12065
                    rect.top = y;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12066
                    rect.right = x+w;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12067
                    rect.bottom = y+h;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12068
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12069
                    FillRect(hDC, &rect, hBrush);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12070
                    _DeleteBrush(hBrush, __LINE__);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12071
                    ReleaseDC(hWnd, hDC);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12072
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12073
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12074
                if (__debug_WM_PAINT__ | __debug_WM_ALL__) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12075
                    PRINTF((">>> WM_PAINT -> expose %d/%d -> %d/%d\n", x, y, w, h));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12076
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12077
                (*exp.ilc_func)(self,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12078
                         @symbol(exposeX:y:width:height:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12079
                         nil, &exp,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12080
                         __MKSMALLINT(x),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12081
                         __MKSMALLINT(y),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12082
                         __MKSMALLINT(w),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12083
                         __MKSMALLINT(h),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12084
                         theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12085
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12086
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12087
            case WM_LBUTTONDBLCLK:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12088
                isDoubleClick = 1;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12089
                butt = __MKSMALLINT(Button1);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12090
                goto commonButton;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12091
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12092
            case WM_LBUTTONUP:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12093
                isDown = 0;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12094
                butt = __MKSMALLINT(Button1);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12095
                goto commonButton;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12096
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12097
            case WM_LBUTTONDOWN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12098
                butt = __MKSMALLINT(Button1);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12099
                goto commonButton;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12100
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12101
            case WM_MBUTTONDBLCLK:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12102
                isDoubleClick = 1;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12103
                butt = __MKSMALLINT(Button2);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12104
                goto commonButton;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12105
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12106
            case WM_MBUTTONUP:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12107
                isDown = 0;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12108
                butt = __MKSMALLINT(Button2);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12109
                goto commonButton;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12110
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12111
            case WM_MBUTTONDOWN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12112
                butt = __MKSMALLINT(Button2);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12113
                goto commonButton;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12114
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12115
            case WM_RBUTTONDBLCLK:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12116
                isDoubleClick = 1;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12117
                butt = __MKSMALLINT(Button3);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12118
                goto commonButton;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12119
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12120
            case WM_RBUTTONUP:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12121
                isDown = 0;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12122
                butt = __MKSMALLINT(Button3);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12123
                goto commonButton;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12124
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12125
            case WM_RBUTTONDOWN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12126
                butt = __MKSMALLINT(Button3);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12127
                goto commonButton;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12128
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12129
            commonButton:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12130
                x = ev->ev_x;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12131
                y = ev->ev_y;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12132
                modifiers = ev->ev_modifiers;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12133
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12134
                if (__INST(buttonTranslation) != nil) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12135
                    butt = __AT_(__INST(buttonTranslation), butt);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12136
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12137
                arg = butt;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12138
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12139
                __INST(altDown) = (modifiers & AltMask) ? true : false;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12140
                __INST(metaDown) = (modifiers & MetaMask) ? true : false;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12141
                __INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12142
                __INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12143
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12144
                if (deltaDoubleClickX == -999) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12145
                    deltaDoubleClickX = GetSystemMetrics(SM_CXDOUBLECLK);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12146
                    deltaDoubleClickY = GetSystemMetrics(SM_CYDOUBLECLK);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12147
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12148
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12149
                if (isDoubleClick) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12150
                    multiClickCount = 2;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12151
                    ipS = &bmp;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12152
                    symS = @symbol(buttonMultiPress:x:y:view:);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12153
                    nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12154
                } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12155
                    if (isDown) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12156
                        if (multiClickCount
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12157
                         && (ev->ev_time < nextMultiClickTime)
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12158
                         && (butt == lastButton)
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12159
                         && (x >= (lastClickX - (deltaDoubleClickX / 2)))
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12160
                         && (x <= (lastClickX + (deltaDoubleClickX / 2)))
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12161
                         && (y >= (lastClickY - (deltaDoubleClickY / 2)))
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12162
                         && (y <= (lastClickY + (deltaDoubleClickY / 2)))
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12163
                        ) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12164
                            ipS = &bmp;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12165
                            symS = @symbol(buttonMultiPress:x:y:view:);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12166
                        } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12167
                            ipS = &bp;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12168
                            symS = @symbol(buttonPress:x:y:view:);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12169
                            multiClickCount = 0;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12170
                        }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12171
                        multiClickCount = multiClickCount + 1;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12172
                        nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12173
                    } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12174
                        ipS = &br;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12175
                        symS = @symbol(buttonRelease:x:y:view:);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12176
                    }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12177
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12178
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12179
                if (isDown || isDoubleClick) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12180
                    lastClickX = x;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12181
                    lastClickY = y;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12182
                    lastButton = butt;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12183
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12184
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12185
                if (__debug_WM_BUTTONUP__ | __debug_WM_BUTTONDOWN__ | __debug_WM_ALL__) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12186
                    if (__isSymbol(arg)) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12187
                        PRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12188
                                    __stringVal(arg), x, y));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12189
                    } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12190
                        PRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12191
                                    __intVal(arg), x, y));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12192
                    }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12193
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12194
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12195
                (*(*ipS).ilc_func)(self, symS, nil, ipS,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12196
                                   arg,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12197
                                   __MKSMALLINT(x),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12198
                                   __MKSMALLINT(y),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12199
                                   theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12200
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12201
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12202
            case __WM_MOUSEENTER:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12203
                x = ev->ev_x;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12204
                y = ev->ev_y;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12205
                state = ev->ev_modifiers;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12206
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12207
                if (__debug_WM_MOUSEENTER__ | __debug_WM_ALL__) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12208
                    PRINTF((">>> WM_MOUSEENTER: %x %d/%d state:%x\n", ev->ev_hWnd, x, y, state));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12209
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12210
#if 0
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12211
                if (GetWindow_unmapping(hWnd)) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12212
                    console_fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12213
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12214
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12215
                (*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12216
                                    nil, &pe,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12217
                                    __MKSMALLINT(state),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12218
                                    __MKSMALLINT(x),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12219
                                    __MKSMALLINT(y),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12220
                                    theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12221
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12222
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12223
            case __WM_MOUSELEAVE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12224
                state = ev->ev_modifiers;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12225
                if (__debug_WM_MOUSELEAVE__ | __debug_WM_ALL__) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12226
                    PRINTF((">>> WM_MOUSELEAVE: %x state:%x\n", ev->ev_hWnd, state));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12227
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12228
#if 0
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12229
                if (GetWindow_unmapping(hWnd)) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12230
                    console_fprintf(stderr, "oops - WM_MOUSELEAVE for unmapping\n");
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12231
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12232
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12233
                (*pl.ilc_func)(self, @symbol(pointerLeave:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12234
                                    nil, &pl,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12235
                                    __MKSMALLINT(state),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12236
                                    theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12237
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12238
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12239
            case WM_MOUSEMOVE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12240
                x = ev->ev_x;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12241
                y = ev->ev_y;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12242
                state = ev->ev_modifiers;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12243
                if (__debug_WM_MOUSEMOVE__ | __debug_WM_ALL__) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12244
                    PRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12245
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12246
                (*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12247
                                    nil, &mot,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12248
                                    __MKSMALLINT(state),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12249
                                    __MKSMALLINT(x),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12250
                                    __MKSMALLINT(y),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12251
                                    theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12252
                break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12253
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 12254
#ifdef WM_MOUSEWHEEL
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12255
            case WM_MOUSEWHEEL:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12256
                x = ev->ev_x;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12257
                y = ev->ev_y;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12258
                state = ev->ev_modifiers;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12259
                dir = GET_WHEEL_DELTA_WPARAM(ev->ev_wParam);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12260
                // dir = ev->ev_wParam & 0xFFFF;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12261
                DPRINTF((">>> WM_MOUSEWHEEL: %d %x\n", dir, state));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12262
                {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12263
                    OBJ tim;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12264
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12265
                    __PROTECT__(theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12266
                    tim = __MKUINT(ev->ev_time);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12267
                    __UNPROTECT__(theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12268
                    (*mwh.ilc_func)(self, @symbol(mouseWheelMotion:x:y:amount:deltaTime:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12269
                                    nil, &mwh,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12270
                                    __MKSMALLINT(state),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12271
                                    __MKSMALLINT(x),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12272
                                    __MKSMALLINT(y),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12273
                                    __MKSMALLINT(dir),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12274
                                    tim,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12275
                                    theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12276
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12277
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12278
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12279
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12280
            case WM_CHAR:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12281
                DPRINTFIF((__debug_WM_CHAR__ | __debug_WM_ALL__)  , ("WM_CHAR %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12282
                DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12283
                symS = @symbol(keyPress:x:y:view:);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12284
                ipS = &skp;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12285
                upDown = true;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12286
                goto keyPressAndRelease;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12287
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12288
            case WM_HOTKEY:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12289
                {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12290
                (*hkp.ilc_func)(self, @symbol(hotkeyWithId:key:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12291
                                    nil, &hkp,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12292
                                    __MKSMALLINT(ev->ev_wParam),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12293
                                    __MKSMALLINT(ev->ev_arg1),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12294
                                    theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12295
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12296
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12297
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12298
            case WM_SYSKEYUP:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12299
            case WM_KEYUP:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12300
                DPRINTFIF((__debug_WM_KEYUP__ | __debug_WM_ALL__)  , (">>> WM_KEYUP / SYSKEYUP: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12301
                symS = @symbol(keyRelease:x:y:view:);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12302
                ipS = &skr;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12303
                upDown = false;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12304
                goto keyPressAndRelease;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12305
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12306
            case WM_SYSKEYDOWN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12307
            case WM_KEYDOWN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12308
                DPRINTFIF((__debug_WM_KEYUP__ | __debug_WM_ALL__)  , (">>> WM_KEYDOWN / SYSKEYDOWN: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12309
                symS = @symbol(keyPress:x:y:view:);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12310
                ipS = &skp;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12311
                upDown = true;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12312
                /* FALL INTO */
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12313
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12314
            keyPressAndRelease: ;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12315
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12316
                x = ev->ev_x;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12317
                y = ev->ev_y;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12318
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12319
#ifdef NOTDEF
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12320
                {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12321
                    BYTE vKeyState[256];
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12322
                    char buff[5];
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12323
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12324
                    GetKeyboardState(vKeyState);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12325
                    ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12326
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12327
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12328
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12329
                keyCode = ev->ev_keyCode;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12330
                modifiers = ev->ev_modifiers;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12331
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12332
                if (modifiers & TRANSLATED_KEY) {
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 12333
#if 1
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12334
                    if (modifiers & ControlMask) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12335
                        if (keyCode < 0x20) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12336
                            keyCode = keyCode + 'a' - 1;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12337
                            if (modifiers & ShiftMask) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12338
                                keyCode = keyCode - 'a' + 'A';
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12339
                            }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12340
                        }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12341
                    } else if (modifiers & (MetaMask | AltMask)) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12342
                        if (! (modifiers & ShiftMask)) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12343
                            if ((keyCode >= 'A') && (keyCode <= 'Z')) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12344
                                keyCode = keyCode - 'A' + 'a';
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12345
                            }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12346
                        }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12347
                    }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12348
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12349
                    arg = __MKSMALLINT(keyCode & 0xFFFF);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12350
                } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12351
                    switch (keyCode) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12352
                        case VK_F1:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12353
                            arg = @symbol(F1);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12354
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12355
                        case VK_F2:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12356
                            arg = @symbol(F2);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12357
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12358
                        case VK_F3:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12359
                            arg = @symbol(F3);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12360
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12361
                        case VK_F4:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12362
                            arg = @symbol(F4);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12363
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12364
                        case VK_F5:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12365
                            arg = @symbol(F5);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12366
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12367
                        case VK_F6:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12368
                            arg = @symbol(F6);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12369
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12370
                        case VK_F7:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12371
                            arg = @symbol(F7);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12372
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12373
                        case VK_F8:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12374
                            arg = @symbol(F8);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12375
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12376
                        case VK_F9:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12377
                            arg = @symbol(F9);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12378
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12379
                        case VK_F10:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12380
                            arg = @symbol(F10);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12381
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12382
                        case VK_F11:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12383
                            arg = @symbol(F11);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12384
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12385
                        case VK_F12:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12386
                            arg = @symbol(F12);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12387
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12388
                        case VK_PRIOR:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12389
                            arg = @symbol(Prior);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12390
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12391
                        case VK_NEXT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12392
                            arg = @symbol(Next);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12393
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12394
                        case VK_END:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12395
                            arg = @symbol(End);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12396
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12397
                        case VK_HOME:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12398
                            arg = @symbol(Home);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12399
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12400
                        case VK_LEFT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12401
                            arg = @symbol(CursorLeft);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12402
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12403
                        case VK_RIGHT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12404
                            arg = @symbol(CursorRight);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12405
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12406
                        case VK_UP:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12407
                            arg = @symbol(CursorUp);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12408
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12409
                        case VK_DOWN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12410
                            arg = @symbol(CursorDown);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12411
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12412
                        case VK_MENU:  /*alt key with w95 ???*/
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12413
                            arg = @symbol(Menu);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12414
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12415
                        case VK_LMENU:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12416
                            arg = @symbol(Menu_L);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12417
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12418
                        case VK_RMENU:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12419
                            arg = @symbol(Menu_R);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12420
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12421
                        case VK_PAUSE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12422
                            arg = @symbol(Pause);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12423
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12424
                        case VK_HELP:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12425
                            arg = @symbol(Help);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12426
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12427
                        case VK_EXECUTE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12428
                            arg = @symbol(Execute);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12429
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12430
                        case VK_CANCEL:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12431
                            arg = @symbol(Cancel);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12432
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12433
                        case VK_SELECT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12434
                            arg = @symbol(Select);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12435
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12436
                        case VK_PRINT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12437
                            arg = @symbol(Print);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12438
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12439
                        case VK_SNAPSHOT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12440
                            arg = @symbol(Snapshot);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12441
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12442
                        case VK_INSERT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12443
                            arg = @symbol(Insert);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12444
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12445
                        case VK_DELETE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12446
                            arg = @symbol(Delete);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12447
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12448
                        case VK_BACK:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12449
                            arg = @symbol(BackSpace);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12450
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12451
                        case VK_LWIN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12452
                            arg = @symbol(Win_L);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12453
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12454
                        case VK_RWIN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12455
                            arg = @symbol(Win_R);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12456
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12457
                        case VK_APPS:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12458
                            arg = @symbol(Appl);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12459
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12460
                        case VK_NUMPAD0:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12461
                            arg = @symbol(KeyPad0);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12462
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12463
                        case VK_NUMPAD1:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12464
                            arg = @symbol(KeyPad1);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12465
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12466
                        case VK_NUMPAD2:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12467
                            arg = @symbol(KeyPad2);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12468
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12469
                        case VK_NUMPAD3:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12470
                            arg = @symbol(KeyPad3);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12471
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12472
                        case VK_NUMPAD4:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12473
                            arg = @symbol(KeyPad4);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12474
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12475
                        case VK_NUMPAD5:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12476
                            arg = @symbol(KeyPad5);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12477
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12478
                        case VK_NUMPAD6:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12479
                            arg = @symbol(KeyPad6);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12480
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12481
                        case VK_NUMPAD7:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12482
                            arg = @symbol(KeyPad7);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12483
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12484
                        case VK_NUMPAD8:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12485
                            arg = @symbol(KeyPad8);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12486
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12487
                        case VK_NUMPAD9:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12488
                            arg = @symbol(KeyPad9);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12489
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12490
                        case VK_LSHIFT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12491
                            arg = @symbol(Shift_L);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12492
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12493
                        case VK_RSHIFT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12494
                            arg = @symbol(Shift_R);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12495
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12496
                        case VK_LCONTROL:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12497
                            arg = @symbol(Ctrl_L);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12498
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12499
                        case VK_RCONTROL:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12500
                            arg = @symbol(Ctrl_R);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12501
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12502
                        case VK_CONTROL:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12503
                            arg = @symbol(Ctrl);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12504
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12505
                        case VK_SHIFT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12506
                            arg = @symbol(Shift);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12507
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12508
                        case VK_TAB:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12509
                            arg = @symbol(Tab);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12510
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12511
                        case VK_ESCAPE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12512
                            arg = @symbol(Escape);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12513
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12514
                        case VK_NUMLOCK:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12515
                            arg = @symbol(NumLock);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12516
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12517
                        case VK_SCROLL:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12518
                            arg = @symbol(ScrollLock);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12519
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12520
                        case VK_RETURN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12521
                            arg = @symbol(Return);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12522
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12523
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12524
                        default:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12525
#if 0
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12526
                            nameBuffer[0] = 0;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12527
                            GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12528
                            if (__debug_WM_KEYUP__ | __debug_WM_KEYDOWN__ | __debug_WM_CHAR__ | __debug_WM_ALL__) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12529
                                PRINTF(("char is <%d>\n", keyCode));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12530
                            }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12531
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12532
                            arg = __MKSMALLINT(keyCode & 0xFFFF);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12533
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12534
                    }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12535
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12536
                __INST(altDown) = (modifiers & AltMask) ? true : false;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12537
                __INST(metaDown) = (modifiers & MetaMask) ? true : false;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12538
                __INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12539
                __INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12540
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12541
                if (__debug_WM_CHAR__ | __debug_WM_KEYUP__ | __debug_WM_KEYDOWN__ | __debug_WM_ALL__) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12542
                    PRINTF(("%s: code=%x mod=%x ", __stringVal(symS), keyCode, modifiers));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12543
                    PRINTF((" alt=%d meta=%d ", __INST(altDown) == true , __INST(metaDown) == true));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12544
                    PRINTF((" sh=%d ctrl=%d", __INST(shiftDown) == true , __INST(ctrlDown) == true));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12545
                    PRINTF((" arg=%x\n", arg));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12546
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12547
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12548
                (*(*ipS).ilc_func)(self, symS, nil, ipS,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12549
                                   arg,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12550
                                   __MKSMALLINT(x),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12551
                                   __MKSMALLINT(y),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12552
                                   theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12553
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12554
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12555
           case WM_SYSCOLORCHANGE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12556
                DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12557
                (*sysClrChg.ilc_func)(self, @symbol(systemColorChange:), nil, &sysClrChg, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12558
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12559
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12560
           case WM_FONTCHANGE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12561
                DPRINTF((">>> WM_FONTCHANGE\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12562
                (*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12563
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12564
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12565
           case WM_WININICHANGE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12566
                DPRINTF((">>> WM_WININICHANGE\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12567
                (*settingChg.ilc_func)(self, @symbol(settingsChange), nil, &settingChg);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12568
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12569
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12570
           case WM_DISPLAYCHANGE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12571
                DPRINTF((">>> WM_DISPLAYCHANGE\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12572
                (*fontChg.ilc_func)(self, @symbol(displayChange), nil, &fontChg);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12573
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12574
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12575
           case WM_QUERYENDSESSION:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12576
                DPRINTF((">>> WM_QUERYENDSESSION\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12577
                (*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12578
                break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12579
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12580
#ifdef LATER
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12581
           case WM_POWER:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12582
                DPRINTF((">>> WM_POWER\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12583
                (*power.ilc_func)(self, @symbol(powerDown), nil, &power);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12584
               break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12585
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12586
            /* native widget actions */
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12587
            case WM_COMMAND:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12588
                DPRINTF((">>> WM_COMMAND\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12589
                (*command.ilc_func)(self, @symbol(nativeWidgetCommand:view:), nil, &command,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12590
                                __MKSMALLINT(ev->ev_wParam), theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12591
               break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12592
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12593
            /* tray action */
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12594
            case WM_TRAY_MESSAGE:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12595
                DPRINTF((">>> WM_TRAY_MESSAGE\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12596
                (*trayMessage.ilc_func)(self, @symbol(trayAction:view:), nil, &trayMessage,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12597
                                __MKSMALLINT(ev->ev_arg1), theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12598
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12599
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12600
            /* message from another process */
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12601
            case WM_COPYDATA:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12602
                DPRINTF((">>> WM_COPYDATA"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12603
                {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12604
                    OBJ eventData;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12605
                    void *data = (void *)(ev->ev_arg1);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12606
                    DPRINTFIF((__debug_WM_COPYDATA__) , (">>> WM_COPYDATA %s (%d)\n", data, ev->ev_arg2));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12607
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12608
                    if (data) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12609
                        eventData = __MKBYTEARRAY(data, (int)ev->ev_arg2);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12610
                        free(data);     // see winEventProcessing()
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12611
                    } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12612
                        eventData = nil;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12613
                    }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12614
                    (*copyData.ilc_func)(self, @symbol(copyDataEvent:eventData:view:), nil, &copyData,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12615
                                __MKSMALLINT(ev->ev_wParam), eventData, theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12616
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12617
                break;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12618
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 12619
#ifdef LATER
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12620
            case WM_QUIT:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12621
                DPRINTF((">>> WM_QUIT_MESSAGE\n"));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12622
                (*quit.ilc_func)(self, @symbol(quitCommand:), nil, &quit);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12623
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12624
#endif
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12625
            case WM_HSCROLL:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12626
            case WM_VSCROLL:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12627
                {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12628
                    int scrollCode = 0;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12629
                    OBJ scrollCodeOrScrollCodeSymbol = nil, positionOrNil = nil;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12630
                    int pos = 0;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12631
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12632
                    scrollCode = LOWORD(ev->ev_wParam);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12633
                    scrollCodeOrScrollCodeSymbol = __MKSMALLINT(scrollCode);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12634
                    positionOrNil = nil;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12635
                    switch (scrollCode) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12636
                        case SB_BOTTOM:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12637
                            scrollCodeOrScrollCodeSymbol = @symbol(SB_BOTTOM);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12638
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12639
                        case SB_TOP:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12640
                            scrollCodeOrScrollCodeSymbol = @symbol(SB_TOP);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12641
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12642
                        case SB_ENDSCROLL:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12643
                            scrollCodeOrScrollCodeSymbol = @symbol(SB_ENDSCROLL);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12644
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12645
                        case SB_LINEDOWN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12646
                            if (ev->ev_message == WM_HSCROLL) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12647
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_LINERIGHT);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12648
                            } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12649
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEDOWN);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12650
                            }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12651
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12652
                        case SB_LINEUP:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12653
                            if (ev->ev_message == WM_HSCROLL) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12654
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_LINELEFT);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12655
                            } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12656
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEUP);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12657
                            }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12658
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12659
                        case SB_PAGEDOWN:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12660
                            if (ev->ev_message == WM_HSCROLL) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12661
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGERIGHT);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12662
                            } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12663
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEDOWN);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12664
                            }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12665
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12666
                        case SB_PAGEUP:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12667
                            if (ev->ev_message == WM_HSCROLL) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12668
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGELEFT);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12669
                            } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12670
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEUP);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12671
                            }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12672
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12673
                        case SB_THUMBPOSITION:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12674
                            if (ev->ev_message == WM_HSCROLL) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12675
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONHORIZONTAL);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12676
                            } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12677
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONVERTICAL);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12678
                            }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12679
                            pos = HIWORD(ev->ev_wParam);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12680
                            positionOrNil = __MKSMALLINT(pos);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12681
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12682
                        case SB_THUMBTRACK:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12683
                            if (ev->ev_message == WM_HSCROLL) {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12684
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKHORIZONTAL);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12685
                            } else {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12686
                                scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKVERTICAL);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12687
                            }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12688
                            pos = HIWORD(ev->ev_wParam);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12689
                            positionOrNil = __MKSMALLINT(pos);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12690
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12691
                        default:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12692
                            DPRINTF((">>> WM_SCROLL: unhandled scrollCode:%d %d\n", scrollCode));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12693
                            break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12694
                    }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12695
                    NDPRINTF((">>> WM_SCROLL: %d %d\n", scrollCode, pos));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12696
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12697
                    (*win32NativeScroll.ilc_func)(self, @symbol(win32NativeScroll:position:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12698
                                        nil, &win32NativeScroll,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12699
                                        scrollCodeOrScrollCodeSymbol,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12700
                                        positionOrNil,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12701
                                        theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12702
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12703
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12704
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12705
            case WM_DRAWITEM:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12706
                {
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12707
                    NDPRINTF((">>> WM_DRAWITEM: wParam: %x\n", ev->ev_wParam));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12708
                    (*win32DrawItem.ilc_func)(self, @symbol(win32DrawItem:view:),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12709
                                        nil, &win32DrawItem,
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12710
                                        __MKSMALLINT(ev->ev_wParam),
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12711
                                        theView);
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12712
                }
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12713
                break;
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12714
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12715
            default:
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12716
                UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: >>> unhandled event: %x\n", ev->ev_message));
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 12717
                break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12718
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12719
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12720
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12721
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12722
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12723
dispatchPendingEvents
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12724
    "central event handling method for modal operation.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12725
     (i.e. this is now only used in the modal debugger)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12726
     Dispatch any pending events; return when no more are pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12727
     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
 12728
     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
 12729
     we only handle exposes until the graphicsExpose arrives.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12730
     Other systems may not need such a kludge"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12731
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12732
    [self eventPendingWithSync:false] whileTrue:[
4440
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12733
	(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
 12734
	    AbortOperationRequest handle:[:ex |
4440
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12735
		ex return
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12736
	    ] do:[
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12737
		self dispatchLastEvent.
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12738
		"/ multi-screen config: give others a chance
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12739
		"/ (needed because we run at high (non-timesliced) prio)
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12740
		Processor yield.
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12741
	    ]
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12742
	].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12743
    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12744
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12745
    "Modified: 19.8.1997 / 17:11:18 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12746
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12747
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12748
disposeEventsWithMask:aMask for:aWindowIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12749
    "dispose (throw away) specific events. If aWindowId is nil,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12750
     events matching the mask are thrown away regardless of which
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12751
     view they are for. Otherwise, only matching events for that
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12752
     view are flushed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12753
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12754
%{  /* NOCONTEXT */
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 12755
   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
 12756
   RETURN ( self );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12757
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12758
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12759
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12760
eventMaskFor:anEventSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12761
    "return the eventMask bit-constant corresponding to an event symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12762
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12763
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12764
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12765
    int m = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12766
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12767
    if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12768
    else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12769
    else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12770
    else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12771
    else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12772
    else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12773
    else if (anEventSymbol == @symbol(expose)) m = ExposureMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12774
    else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12775
    else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12776
    else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12777
    else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12778
    else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12779
    else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12780
    else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12781
    else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12782
    else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12783
    RETURN (__MKSMALLINT(m));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12784
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12785
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12786
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12787
eventPending
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12788
    "return true, if any event is pending.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12789
     This looks for both the internal queue and the display connection."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12790
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12791
    ^ self eventPendingWithSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12792
!
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
eventPending:anEventSymbol for:aWindowIdOrNil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12795
    "return true, if a specific event is pending"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12796
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12797
    ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12798
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12799
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12800
eventPendingWithSync:doSync
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12801
    "return true, if any event is pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12802
     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
 12803
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12804
    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
 12805
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12806
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12807
    if (hasEventQueued()) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12808
	RETURN (true);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12809
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12810
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12811
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12812
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12813
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12814
eventQueued
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12815
    "return true, if any event is queued"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12816
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12817
    ^ self eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12818
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12819
    "Created: 12.12.1995 / 21:43:00 / stefan"
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
eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12823
    "return true, if any event is queued internally.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12824
     (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
 12825
      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
 12826
      the display connection)."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12827
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12828
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12829
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 12830
    DDDPRINTF(("peek q - "));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12831
    if (hasEventQueued()) {
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 12832
	DDDPRINTF(("true\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12833
	RETURN (true);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12834
    }
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 12835
    DDDPRINTF(("false\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12836
%}.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12837
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12838
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12839
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12840
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12841
    "return true, if any of the masked events is pending.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12842
     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
 12843
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12844
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12845
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
 12846
    DDDPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12847
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12848
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12849
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12850
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12851
exposeEventPendingFor:aWindowIdOrNil withSync:doSync
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12852
    "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
 12853
     or any view (if the arg is nil).
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12854
     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
 12855
1127
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
getEventFor:aViewIdOrNil withMask:eventMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12860
    "read next event - put into local eventBuffer.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12861
     If aViewIdOrNil is nil, events for any view are fetched;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12862
     otherwise only events for that specific view will be fetched.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12863
     Returns true, if there was an event, false otherwise."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12864
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12865
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12866
    HWND win, wWanted;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12867
    int evMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12868
    OBJ eB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12869
    struct queuedEvent *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12870
    struct queuedEvent *qev;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12871
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12872
    eB = __INST(eventBuffer);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12873
    if (! __isByteArray(eB)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 12874
	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
 12875
	/* RETURN (false); */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12876
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12877
	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
 12878
	ev->ev_message = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12879
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12880
	if (__isSmallInteger(eventMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12881
	    evMask = __intVal(eventMask);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12882
	} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12883
	    evMask = ~0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12884
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12885
	if (__isExternalAddress(aViewIdOrNil)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12886
	    wWanted = _HWNDVal(aViewIdOrNil);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12887
	} else{
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12888
	    wWanted = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12889
	}
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 12890
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12891
	do { /* only to allow continue */
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12892
	    if (deqEvent(ev, wWanted, evMask)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12893
#ifdef COMPRESS_WINDOWPOSCHANGED
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12894
		if ((ev->ev_hWnd == lastPos_win)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12895
		 && (ev->ev_message == WM_WINDOWPOSCHANGED)
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12896
		 && ((ev->ev_x != lastPos_x)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12897
		     || (ev->ev_y != lastPos_y)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12898
		     || (ev->ev_w != lastPos_w)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12899
		     || (ev->ev_h != lastPos_h))) {
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12900
		    /*
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12901
		     * ignore intermediate resize events
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12902
		     * (that event is an intermediate one, because the peek-values
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12903
		     *  have already been updated for another event)
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12904
		     */
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12905
		    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
 12906
				  ev->ev_x, lastPos_x,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12907
				  ev->ev_y, lastPos_y,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12908
				  ev->ev_w, lastPos_w,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12909
				  ev->ev_h, lastPos_h ));
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12910
		    continue;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12911
		}
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12912
#endif
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12913
		RETURN ( true );
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12914
	    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12915
	} while (0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12916
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12917
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12918
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12919
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12920
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12921
handleAllEvents
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12922
    "from now on, handle any kind of event.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12923
     Always with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12924
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12925
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12926
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12927
handleExposeOnlyFor:aView
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12928
    "from now on, handle expose events only.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12929
     Never with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12930
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12931
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12932
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12933
registerHotKeyForWindow:aDrawableId withId:anId modifiers:aModifier virtualKeyCode:aVirtualKeyCode
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12934
    "Defines a system-wide hot key."
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12935
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12936
%{  /* NOCONTEXT */
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12937
    static registerHotKeyInfo rhki;
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12938
    HWND hWnd = NULL;
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12939
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12940
    if (__isExternalAddress(aDrawableId)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12941
	hWnd = _HWNDVal(aDrawableId);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12942
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12943
	if (! hWnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12944
	    RETURN (false);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12945
	}
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12946
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12947
	RETURN (false);
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12948
    }
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12949
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12950
    rhki.hwnd       = hWnd;
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12951
    rhki.hotKeyId   = __intVal(anId);
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12952
    rhki.modifier   = __intVal(aModifier);
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12953
    rhki.virtualKey = __intVal(aVirtualKeyCode);
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12954
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12955
    if (PostThreadMessage(_dispatchThreadId, WM_THREAD_REGISTERHOTKEY, 0, (INT)(&rhki)) == FALSE) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12956
	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
 12957
					_dispatchThreadId, GetLastError() );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12958
	RETURN (false);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12959
    }
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12960
%}.
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12961
    ^ true
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12962
!
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12963
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12964
setEventMask:aMask in:aWindowId
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 12965
    "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
 12966
     is the bitwise-or of the eventMask bits (see 'eventMaskFor:')"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12967
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12968
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12969
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12970
    if (__isExternalAddress(aWindowId)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12971
     && __isSmallInteger(aMask)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12972
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12973
	int mask = __intVal(aMask);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12974
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12975
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 12976
	lI = GETLOCALWINDOWINFOPTR(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 12977
	if (lI) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12978
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12979
	    PRINTF(("new eventMask %x\n",mask));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12980
	    printMask(mask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12981
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12982
	    lI->eventMask = mask;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12983
	    RETURN ( self );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12984
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12985
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12986
%}.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12987
    self primitiveFailed
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12988
!
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12989
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12990
unregisterHotKeyForWindow:aDrawableId withId:anId
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12991
    "Defines a system-wide hot key."
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12992
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12993
%{  /* NOCONTEXT */
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12994
    static registerHotKeyInfo rhki;
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12995
    HWND hWnd = NULL;
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
    if (__isExternalAddress(aDrawableId)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12998
	hWnd = _HWNDVal(aDrawableId);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12999
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13000
	if (! hWnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13001
	    RETURN (false);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13002
	}
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13003
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13004
	RETURN (false);
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13005
    }
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13006
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13007
    rhki.hwnd       = hWnd;
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13008
    rhki.hotKeyId   = __intVal(anId);
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13009
    rhki.modifier   = 0;
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13010
    rhki.virtualKey = 0;
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13011
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13012
    if (PostThreadMessage(_dispatchThreadId, WM_THREAD_UNREGISTERHOTKEY, 0, (INT)(&rhki)) == FALSE) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13013
	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
 13014
					_dispatchThreadId, GetLastError() );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13015
	RETURN (false);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13016
    }
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13017
%}.
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13018
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13019
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13020
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13021
!WinWorkstation methodsFor:'event sending'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13022
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13023
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
 13024
    "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
 13025
     TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13026
     For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13027
     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
 13028
     or a numeric keysym code or a character.
8013
c88e98d6690e #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8012
diff changeset
 13029
     If state is nil, the modifier bits (shift & control)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13030
     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
 13031
     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
 13032
     (not very user friendly)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13033
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13034
    |ok xLog yLog targetId|
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13035
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13036
    (xPos notNil and:[yPos notNil]) ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13037
	"/ scale 0..width to 0..16rFFFF
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13038
	xLog := xPos * 16rFFFF // self width.
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13039
	yLog := yPos * 16rFFFF // self height.
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13040
    ].
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13041
    (targetIdArg notNil and:[targetIdArg ~= self rootWindowId]) ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13042
	targetId := targetIdArg.
8012
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
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13045
    ok := false.
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13046
%{
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13047
    BOOL rslt;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13048
    HWND hWnd = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13049
    UINT msg;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13050
    WPARAM wParam = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13051
    LPARAM lParam = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13052
    DWORD dwFlags = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13053
    int _isMouseEvent = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13054
    int _isKeyEvent = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13055
    int _keyCodeOrButtonNr = -1;
8014
9b3128e00e64 #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8013
diff changeset
 13056
    int _shifted = 0;
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13057
    int _xP = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13058
    int _yP = 0;
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13059
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13060
    if (__isExternalAddress(targetId)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13061
	hWnd = _HWNDVal(targetId);
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13062
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13063
    if (__isSmallInteger(keySymCodeOrButtonNr)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13064
	_keyCodeOrButtonNr = __intVal(keySymCodeOrButtonNr);
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13065
    } else {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13066
	if (__isCharacter(keySymCodeOrButtonNr)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13067
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13068
	    _keyCodeOrButtonNr = __intVal(__characterVal(keySymCodeOrButtonNr));
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13069
	    DPRINTF(("code: %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13070
	    if ((_keyCodeOrButtonNr >= 'a') && (_keyCodeOrButtonNr <= 'z')) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13071
		_keyCodeOrButtonNr -= 0x20;
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13072
		DPRINTF(("code: %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13073
	    } else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13074
		if ((_keyCodeOrButtonNr >= 'A') && (_keyCodeOrButtonNr <= 'Z')) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13075
		    DPRINTF(("code: shifted %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13076
		    _shifted = 1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13077
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13078
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13079
	} else if (keySymCodeOrButtonNr == @symbol(Return)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13080
	    _keyCodeOrButtonNr = VK_RETURN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13081
	} else if (keySymCodeOrButtonNr == @symbol(Enter)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13082
	    _keyCodeOrButtonNr = VK_RETURN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13083
	} else if (keySymCodeOrButtonNr == @symbol(BackSpace)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13084
	    _keyCodeOrButtonNr = VK_BACK;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13085
	} else if (keySymCodeOrButtonNr == @symbol(Tab)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13086
	    _keyCodeOrButtonNr = VK_TAB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13087
	} else if (keySymCodeOrButtonNr == @symbol(Shift)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13088
	    _keyCodeOrButtonNr = VK_SHIFT;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13089
	} else if (keySymCodeOrButtonNr == @symbol(Ctrl)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13090
	    _keyCodeOrButtonNr = VK_CONTROL;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13091
	} else if (keySymCodeOrButtonNr == @symbol(Menu)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13092
	    _keyCodeOrButtonNr = VK_MENU;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13093
	} else if (keySymCodeOrButtonNr == @symbol(Escape)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13094
	    _keyCodeOrButtonNr = VK_ESCAPE;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13095
	} else if (keySymCodeOrButtonNr == @symbol(Space)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13096
	    _keyCodeOrButtonNr = VK_SPACE;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13097
	} else if (keySymCodeOrButtonNr == @symbol(Prior)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13098
	    _keyCodeOrButtonNr = VK_PRIOR;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13099
	} else if (keySymCodeOrButtonNr == @symbol(Next)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13100
	    _keyCodeOrButtonNr = VK_NEXT;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13101
	} else if (keySymCodeOrButtonNr == @symbol(End)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13102
	    _keyCodeOrButtonNr = VK_END;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13103
	} else if (keySymCodeOrButtonNr == @symbol(Home)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13104
	    _keyCodeOrButtonNr = VK_HOME;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13105
	} else if (keySymCodeOrButtonNr == @symbol(Left)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13106
	    _keyCodeOrButtonNr = VK_LEFT;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13107
	} else if (keySymCodeOrButtonNr == @symbol(Right)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13108
	    _keyCodeOrButtonNr = VK_RIGHT;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13109
	} else if (keySymCodeOrButtonNr == @symbol(Down)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13110
	    _keyCodeOrButtonNr = VK_DOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13111
	} else if (keySymCodeOrButtonNr == @symbol(Up)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13112
	    _keyCodeOrButtonNr = VK_UP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13113
	} else if (keySymCodeOrButtonNr == @symbol(Insert)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13114
	    _keyCodeOrButtonNr = VK_INSERT;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13115
	} else if (keySymCodeOrButtonNr == @symbol(Delete)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13116
	    _keyCodeOrButtonNr = VK_DELETE;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13117
	} else if (keySymCodeOrButtonNr == @symbol(Help)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13118
	    _keyCodeOrButtonNr = VK_HELP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13119
	} else if (keySymCodeOrButtonNr == @symbol(F1)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13120
	    _keyCodeOrButtonNr = VK_F1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13121
	} else if (keySymCodeOrButtonNr == @symbol(F2)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13122
	    _keyCodeOrButtonNr = VK_F2;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13123
	} else if (keySymCodeOrButtonNr == @symbol(F3)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13124
	    _keyCodeOrButtonNr = VK_F3;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13125
	} else if (keySymCodeOrButtonNr == @symbol(F4)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13126
	    _keyCodeOrButtonNr = VK_F4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13127
	} else if (keySymCodeOrButtonNr == @symbol(F5)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13128
	    _keyCodeOrButtonNr = VK_F5;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13129
	} else if (keySymCodeOrButtonNr == @symbol(F6)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13130
	    _keyCodeOrButtonNr = VK_F6;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13131
	} else if (keySymCodeOrButtonNr == @symbol(F7)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13132
	    _keyCodeOrButtonNr = VK_F7;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13133
	} else if (keySymCodeOrButtonNr == @symbol(F8)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13134
	    _keyCodeOrButtonNr = VK_F8;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13135
	} else if (keySymCodeOrButtonNr == @symbol(F9)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13136
	    _keyCodeOrButtonNr = VK_F9;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13137
	} else if (keySymCodeOrButtonNr == @symbol(F10)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13138
	    _keyCodeOrButtonNr = VK_F10;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13139
	} else if (keySymCodeOrButtonNr == @symbol(F11)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13140
	    _keyCodeOrButtonNr = VK_F11;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13141
	} else if (keySymCodeOrButtonNr == @symbol(F12)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13142
	    _keyCodeOrButtonNr = VK_F12;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13143
	} else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13144
	    console_printf("bad key\n");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13145
	    goto getOutOfHere;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13146
	}
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13147
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13148
    if (__isSmallInteger(xLog)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13149
	_xP = __intVal(xLog);
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13150
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13151
    if (__isSmallInteger(yLog)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13152
	_yP = __intVal(yLog);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13153
    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13154
    lParam = _xP | (_yP << 16);
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 (typeSymbol == @symbol(buttonPress)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13157
	_isMouseEvent = 1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13158
	switch (_keyCodeOrButtonNr) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13159
	    case 1:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13160
		msg = WM_LBUTTONDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13161
		wParam = MK_LBUTTON;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13162
		dwFlags = MOUSEEVENTF_LEFTDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13163
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13164
	    case 2:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13165
		msg = WM_MBUTTONDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13166
		wParam = MK_MBUTTON;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13167
		dwFlags = MOUSEEVENTF_MIDDLEDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13168
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13169
	    case 3:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13170
		msg = WM_RBUTTONDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13171
		wParam = MK_RBUTTON;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13172
		dwFlags = MOUSEEVENTF_RIGHTDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13173
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13174
	    default:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13175
		console_printf("bad button\n");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13176
		goto getOutOfHere;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13177
	}
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13178
    } else if (typeSymbol == @symbol(buttonRelease)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13179
	_isMouseEvent = 1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13180
	switch (_keyCodeOrButtonNr) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13181
	    case 1:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13182
		msg = WM_LBUTTONUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13183
		dwFlags = MOUSEEVENTF_LEFTUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13184
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13185
	    case 2:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13186
		msg = WM_MBUTTONUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13187
		dwFlags = MOUSEEVENTF_MIDDLEUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13188
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13189
	    case 3:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13190
		msg = WM_RBUTTONUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13191
		dwFlags = MOUSEEVENTF_RIGHTUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13192
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13193
	    default:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13194
		console_printf("bad button\n");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13195
		goto getOutOfHere;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13196
	}
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13197
    } else if ((typeSymbol == @symbol(keyPress)) || (typeSymbol == @symbol(keyRelease))) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13198
	dwFlags = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13199
	if (typeSymbol == @symbol(keyRelease)) dwFlags = KEYEVENTF_KEYUP;
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13200
    } else {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13201
	console_printf("bad typeSymbol\n");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13202
	goto getOutOfHere;
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13203
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13204
    if (_isMouseEvent) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13205
	if ((xPos == nil) || (yPos == nil)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13206
	    console_printf("bad x/y\n");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13207
	    goto getOutOfHere;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13208
	}
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13209
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13210
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13211
    if (hWnd == 0) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13212
	// send to screen
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
	    mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, _xP, _yP, 0, NULL);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13215
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13216
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13217
	if (_isMouseEvent) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13218
	    DPRINTF(("mouse %08x %d/%d\n", dwFlags | MOUSEEVENTF_ABSOLUTE, _xP, _yP));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13219
	    mouse_event(dwFlags | MOUSEEVENTF_ABSOLUTE, _xP, _yP, 0, NULL);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13220
	} else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13221
	    if (_shifted) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13222
		DPRINTF(("shifted keybd #%08x %d (#%02x)\n", dwFlags, _keyCodeOrButtonNr, _keyCodeOrButtonNr));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13223
		keybd_event( VK_SHIFT, 0 /* _keyCodeOrButtonNr */, 0, 0);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13224
		keybd_event( _keyCodeOrButtonNr, 0 /* _keyCodeOrButtonNr */, dwFlags, 0);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13225
		keybd_event( VK_SHIFT, 0 /* _keyCodeOrButtonNr */, KEYEVENTF_KEYUP, 0);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13226
	    } else {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13227
		DPRINTF(("keybd #%08x %d (#%02x)\n", dwFlags, _keyCodeOrButtonNr, _keyCodeOrButtonNr));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13228
		keybd_event( _keyCodeOrButtonNr, 0 /* _keyCodeOrButtonNr */, dwFlags, 0);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13229
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13230
	}
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13231
    } else {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13232
	rslt = PostMessage(hWnd, msg, wParam, lParam);
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13233
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13234
    ok = true;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13235
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13236
getOutOfHere: ;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13237
%}.
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13238
    ok ifFalse:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13239
	'WinWorkstation [warning]: sendKeyOrButtonEvent unimplemented' infoPrintCR.
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13240
	self primitiveFailed.
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
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13243
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13244
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13245
!WinWorkstation methodsFor:'font stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13246
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13247
createFontFor:aFontName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13248
    "a basic method for font allocation; this method allows
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13249
     any font to be aquired (even those not conforming to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13250
     standard naming conventions, such as cursor, fixed or k14)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13251
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13252
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13253
    HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13254
    char *fn;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13255
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13256
    if (__isStringLike(aFontName)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13257
	fn = __stringVal(aFontName);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13258
	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
 13259
	    hFont = GetStockObject(ANSI_FIXED_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13260
	} 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
 13261
	    hFont = GetStockObject(ANSI_VAR_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13262
	} else if ((strcmp(fn, "system") == 0) || (strcmp(fn, "SYSTEM_FONT") == 0)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13263
	    hFont = GetStockObject(SYSTEM_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13264
	} 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
 13265
	    hFont = GetStockObject(SYSTEM_FIXED_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13266
	} 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
 13267
	    hFont = GetStockObject(DEVICE_DEFAULT_FONT);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13268
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13269
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13270
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13271
	if (hFont) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13272
	    DPRINTF(("createFontFor:%s -> %x\n", fn, hFont));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13273
	    RETURN ( __MKOBJ(hFont) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13274
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13275
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13276
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13277
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13278
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13279
5581
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13280
encodingOf:fontId
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13281
    "return the encoding of the font"
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13282
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13283
    ^ (self fontMetricsOf:fontId) encoding
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13284
!
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13285
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13286
fontDescriptionFromLogicalFontInfoArray:anInfoArray
5649
50c68e749917 changed: #fontDescriptionFromLogicalFontInfoArray:
Claus Gittinger <cg@exept.de>
parents: 5648
diff changeset
 13287
    |fntDescr family face style logicalSize pointSize encoding|
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13288
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13289
    family := anInfoArray at:16.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13290
    face   := anInfoArray at:6.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13291
    style  := anInfoArray at:15.
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13292
    logicalSize   := anInfoArray at:1.
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13293
    encoding := anInfoArray at:17.
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13294
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13295
    logicalSize := logicalSize abs.
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13296
    "/ convert from device to point size
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13297
    pointSize := (logicalSize / self getLogicalPixelSizeY * 72.0).
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13298
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13299
    fntDescr := FontDescription
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13300
		    family:family
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13301
		    face:face
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13302
		    style:style
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13303
		    size:pointSize
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13304
		    sizeUnit:#pt
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13305
		    encoding:encoding.
5198
a95b6a853a3b changed #pixelSize
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
 13306
    fntDescr setPixelSize:logicalSize.
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13307
    ^ fntDescr.
5645
760a83be3f61 changed: #fontDescriptionFromLogicalFontInfoArray:
Claus Gittinger <cg@exept.de>
parents: 5641
diff changeset
 13308
5649
50c68e749917 changed: #fontDescriptionFromLogicalFontInfoArray:
Claus Gittinger <cg@exept.de>
parents: 5648
diff changeset
 13309
    "Modified: / 09-11-2010 / 13:00:18 / cg"
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13310
!
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13311
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13312
fontMetricsOf:fontId
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13313
    "return a fonts metrics info object"
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13314
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13315
    |rawData info|
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13316
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13317
    rawData := Array new:15.
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13318
    (self primFontMetricsOf:fontId intoArray:rawData) isNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13319
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13320
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13321
    ].
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13322
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13323
    info := DeviceWorkstation::DeviceFontMetrics new.
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13324
    info
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13325
      ascent:(rawData at:1)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13326
      descent:(rawData at:2)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13327
      maxAscent:(rawData at:3)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13328
      maxDescent:(rawData at:4)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13329
      minWidth:(rawData at:5)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13330
      maxWidth:(rawData at:6)
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13331
      avgWidth:(rawData at:7)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13332
      minCode:(rawData at:8)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13333
      maxCode:16rFFFF "(rawData at:9)"
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13334
      direction:nil
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13335
      encoding:(rawData at:11).
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13336
    ^ info
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13337
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13338
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13339
fontsInFamily:aFamilyName face:aFaceName filtering:filter
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13340
    "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
 13341
     On WinWorkStations there is curently Face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13342
     But only thise matching filter (if nonNil)."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13343
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13344
    |allFonts fonts|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13345
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13346
    allFonts := self listOfAvailableFonts.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13347
    allFonts isNil ifTrue:[^ nil].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13348
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13349
    fonts := Set new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13350
    allFonts do:[:fntDescr |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13351
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13352
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13353
		fonts add:fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13354
	    ]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13355
	]
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
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13358
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13359
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13360
getAvailableFontsMatching:pattern
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13361
    "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
 13362
    self shouldImplement.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13363
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13364
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13365
5910
da3bcd680026 added: #getDefaultFontWithEncoding:
Stefan Vogel <sv@exept.de>
parents: 5867
diff changeset
 13366
getDefaultFontWithEncoding:encoding
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13367
    "return a default font id - used when class Font cannot
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13368
     find anything usable"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13369
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13370
     ^ self createFontFor:'fixed'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13371
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13372
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13373
getFontWithFamily:familyString face:faceString
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13374
	    style:styleArgString size:sizeArg sizeUnit:sizeUnitArg
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13375
	    encoding:encoding
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13376
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13377
    "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
 13378
     font."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13379
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13380
    |styleString theName theId xlatedStyle id spacing pxSize ptSize encodingSym|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13381
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13382
    styleString := styleArgString.
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13383
    encoding isEmptyOrNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13384
	encodingSym := #'ms-default' "/ encoding.
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13385
    ] ifFalse:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13386
	encodingSym := encoding asLowercase asSymbol.
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13387
    ].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13388
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13389
    "special: if face is nil, allow access to X-fonts"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13390
    faceString isNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13391
	sizeArg notNil ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13392
	    theName := familyString , '-' , sizeArg printString
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13393
	] ifFalse:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13394
	    theName := familyString
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13395
	].
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13396
	theName notNil ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13397
	    theId := self createFontFor:theName.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13398
	].
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13399
	theId isNil ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13400
	    theId := self getDefaultFontWithEncoding:encoding
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13401
	].
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13402
	^ theId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13403
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13404
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13405
    "/ spacing other than 'normal' is contained as last component
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13406
    "/ in style
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13407
    styleString notNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13408
	((styleString endsWith:'-narrow')
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13409
	 or:[styleString endsWith:'-semicondensed']) ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13410
	    |i|
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13411
	    i := styleString lastIndexOf:$-.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13412
	    spacing := styleString copyFrom:(i+1).
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13413
	    styleString := styleString copyTo:(i-1).
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13414
	] ifFalse:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13415
	    spacing := #normal.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13416
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13417
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13418
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13419
    xlatedStyle := styleString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13420
    xlatedStyle notNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13421
	xlatedStyle := xlatedStyle first asString
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13422
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13423
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13424
    pxSize := sizeUnitArg == #px ifTrue:[sizeArg] ifFalse:[nil].
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13425
    ptSize := sizeUnitArg == #pt ifTrue:[sizeArg] ifFalse:[nil].
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13426
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13427
    id := self
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13428
	    getFontWithFoundry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13429
	    family:familyString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13430
	    weight:faceString
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13431
	    slant:styleString "/ xlatedStyle
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13432
	    spacing:spacing
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13433
	    pixelSize:pxSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13434
	    size:ptSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13435
	    registry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13436
	    encoding:encodingSym.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13437
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13438
    id isNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13439
	id := self
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13440
		getFontWithFoundry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13441
		family:familyString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13442
		weight:faceString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13443
		slant:styleString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13444
		spacing:spacing
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13445
		pixelSize:pxSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13446
		size:ptSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13447
		registry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13448
		encoding:encodingSym.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13449
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13450
    ^ id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13451
5587
909a0413b6a2 changed: #getFontWithFamily:face:style:size:sizeUnit:encoding:
sr
parents: 5583
diff changeset
 13452
    "Modified: / 04-07-1996 / 11:38:47 / stefan"
909a0413b6a2 changed: #getFontWithFamily:face:style:size:sizeUnit:encoding:
sr
parents: 5583
diff changeset
 13453
    "Modified: / 04-08-2010 / 18:39:02 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13454
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13455
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13456
getFontWithFoundry:foundry family:family weight:weight
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13457
	      slant:slant spacing:spc pixelSize:pixelSizeOrNil size:pointSize
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13458
	      registry:registry encoding:encodingArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13459
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13460
    "get the specified font, if not available, return nil.
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13461
     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
 13462
     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
 13463
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13464
     foundry:   'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13465
     family:    'helvetica' 'courier' 'times' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13466
     weight:    'bold' 'medium' 'demi' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13467
     slant:     'r(oman)' 'i(talic)' 'o(blique)'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13468
     spacing:   'narrow' 'normal' semicondensed' ... usually '*'
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13469
     pixelSize: 16,18 ... size in pixels; usually left nil
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13470
     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
 13471
     registry:  iso8859, sgi ... '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13472
     encoding:  vendor specific encoding (usually '*')
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13473
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13474
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13475
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13476
     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
 13477
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13478
	nHeight
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13479
	nWidth
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13480
	nEscapement
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13481
	nOrientation
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13482
	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
 13483
	fdwItalic       TRUE or FALSE
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13484
	fdwUnderline    TRUE or FALSE
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13485
	fdwStrikeOut    TRUE or FALSE
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13486
	fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13487
	fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13488
	fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13489
	fdwQuality      DEFAULT, DRAFT, or PROOF.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13490
	fdwPitchAndFamily
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13491
		DEFAULT, FIXED or VARIABLE pitch
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13492
		DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13493
	lpszFace
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13494
		Typeface Name
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13495
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13496
      These two above descriptions will be matched as follows:
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13497
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13498
	foundry   - ignored
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13499
	family    - mapped to type face name.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13500
	weight    - mapped to fnWeight
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13501
	slant     - used for style
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13502
	spacing   - NOT USED INITIALLY
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13503
	pixelSize - NOT USED INITIALLY
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13504
	size      - mapped to nHeight
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13505
	registry  - NOT USED INITIALLY
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13506
	encoding  - mapped to fdwCharSet
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13507
     "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13508
5581
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13509
    |encoding logSize heightIsCellHeight|
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13510
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13511
    encoding := encodingArg asSymbol.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13512
5171
333471dbc830 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5163
diff changeset
 13513
    pixelSizeOrNil notNil ifTrue:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13514
	logSize := pixelSizeOrNil.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13515
	heightIsCellHeight := false.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13516
    ] ifFalse:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13517
	logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13518
	heightIsCellHeight := false.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13519
    ].
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13520
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13521
    HGDIOBJ hFont;
5188
8946ef7cf787 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5184
diff changeset
 13522
    int nHeight, nWidth, nEscapement, nOrientation;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13523
    char* work;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13524
    char* work2;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13525
    DWORD fnWeight;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13526
    DWORD fdwItalic;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13527
    DWORD fdwUnderline;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13528
    DWORD fdwStrikeOut;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13529
    DWORD fdwCharSet;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13530
    DWORD fdwOutputPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13531
    DWORD fdwClipPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13532
    DWORD fdwQuality;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13533
    DWORD fdwPitchAndFamily;
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13534
    static char faceName[256];
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13535
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13536
/* INITIALIZE */
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13537
    strcpy( faceName, "NULL" );
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13538
    nHeight   = 0;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13539
    nWidth   = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13540
    nEscapement = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13541
    nOrientation = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13542
    fnWeight = FW_NORMAL;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13543
    fdwItalic = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13544
    fdwUnderline = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13545
    fdwStrikeOut = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13546
    fdwOutputPrecision = OUT_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13547
    fdwClipPrecision   = CLIP_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13548
    fdwQuality         = DEFAULT_QUALITY;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13549
    fdwPitchAndFamily  = FF_DONTCARE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13550
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13551
    fdwCharSet   = ANSI_CHARSET;
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 13552
    if ((encoding == @symbol('ms-ansi'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13553
	fdwCharSet   = ANSI_CHARSET;
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13554
    } else if (encoding == @symbol('ms-default')
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13555
	       || encoding == @symbol(*)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13556
	fdwCharSet   = DEFAULT_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13557
    } else if ((encoding == @symbol('ms-symbol'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13558
	    || (encoding == @symbol('misc-fontspecific'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13559
	fdwCharSet   = SYMBOL_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13560
    } else if ((encoding == @symbol('ms-shiftjis'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13561
	    || (encoding == @symbol('jisx0208.1983-0'))){
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13562
	fdwCharSet   = SHIFTJIS_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13563
    } else if ((encoding == @symbol('ms-gb2312'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13564
	    || (encoding == @symbol('gb2312.1980-0'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13565
	fdwCharSet   = GB2312_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13566
    } else if ((encoding == @symbol('ms-hangeul'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13567
	    || (encoding == @symbol('ksc5601.1987-0'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13568
	fdwCharSet   = HANGEUL_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13569
    } else if ((encoding == @symbol('ms-chinesebig5'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13570
	    || (encoding == @symbol('big5'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13571
	fdwCharSet   = CHINESEBIG5_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13572
    } else if (encoding == @symbol('ms-oem')) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13573
	fdwCharSet   = OEM_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13574
    } else if (encoding == @symbol('ms-johab')) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13575
	fdwCharSet   = JOHAB_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13576
    } else if ((encoding == @symbol('ms-hebrew'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13577
	    || (encoding == @symbol('ms-cp1255'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13578
	fdwCharSet   = HEBREW_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13579
    } else if ((encoding == @symbol('ms-arabic'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13580
	    || (encoding == @symbol('ms-cp1256'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13581
	fdwCharSet   = ARABIC_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13582
    } else if ((encoding == @symbol('ms-greek'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13583
	    || (encoding == @symbol('ms-cp1253'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13584
	fdwCharSet   = GREEK_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13585
    } else if ((encoding == @symbol('ms-turkish'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13586
	    || (encoding == @symbol('ms-cp1254'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13587
	fdwCharSet   = TURKISH_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13588
    } else if ((encoding == @symbol('ms-russian'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13589
	    || (encoding == @symbol('ms-cp1251'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13590
	fdwCharSet   = RUSSIAN_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13591
    } else if ((encoding == @symbol('ms-easteurope'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13592
	    || (encoding == @symbol('ms-cp1250'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13593
	fdwCharSet   = EASTEUROPE_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13594
    } else if ((encoding == @symbol('ms-baltic'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13595
	    || (encoding == @symbol('ms-cp1257'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13596
	fdwCharSet   = BALTIC_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13597
    } else if ((encoding == @symbol('ms-vietnamese'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13598
	fdwCharSet   = VIETNAMESE_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13599
    } else if ((encoding == @symbol('ms-thai'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13600
	fdwCharSet   = THAI_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13601
    } else if ((encoding == @symbol('ms-mac'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13602
	fdwCharSet   = MAC_CHARSET;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13603
#ifdef UNICODE_CHARSET
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13604
    } else if ((encoding == @symbol('ms-unicode'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13605
	fdwCharSet   = UNICODE_CHARSET;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13606
#endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13607
    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13608
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13609
    if ( __isStringLike( family ) ) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13610
	work = __stringVal( family );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13611
	if (strcmp( work, "nil" ) != 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13612
	    strncpy( faceName, work, sizeof(faceName)-1 );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13613
	}
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13614
    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13615
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 13616
    /* 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
 13617
    if( __isStringLike( weight ) ) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13618
	work = __stringVal( weight );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13619
	if (strcmp( work, "bold" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13620
	    fnWeight = FW_BOLD;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13621
	} else if (strcmp( work, "medium" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13622
	    fnWeight = FW_MEDIUM;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13623
	} else if (strcmp( work, "normal" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13624
	    fnWeight = FW_NORMAL;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13625
	} else if (strcmp( work, "light" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13626
	    fnWeight = FW_LIGHT;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13627
	} else if (strcmp( work, "demi" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13628
	    fnWeight = FW_LIGHT;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13629
	} else if (strcmp( work, "heavy" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13630
	    fnWeight = FW_HEAVY;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13631
	} else if (strcmp( work, "extraBold" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13632
	    fnWeight = FW_EXTRABOLD;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13633
	} else if (strcmp( work, "semiBold" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13634
	    fnWeight = FW_SEMIBOLD;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13635
	} else if (strcmp( work, "thin" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13636
	    fnWeight = FW_THIN;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13637
	} else if (strcmp( work, "extraLight" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13638
	    fnWeight = FW_EXTRALIGHT;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13639
	}
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13640
    } else if (__isSmallInteger(weight)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13641
	fnWeight = __intVal(weight);
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13642
    }
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13643
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13644
    if(__isSmallInteger( logSize )) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13645
	nHeight = __intVal( logSize );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13646
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13647
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13648
    if (__isStringLike(slant)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13649
	work2 = __stringVal( slant );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13650
	work  = __stringVal( slant );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13651
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13652
	if (strncmp(work2, "italic", 6) == 0)  {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13653
	    fdwItalic = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13654
	    if ( work2[6] == '-' )
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13655
		strncpy( work, &work2[7], ( strlen( work2) - 7) );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13656
	} else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13657
	    if (strncmp(work2, "oblique", 7) == 0)  {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13658
		fdwItalic = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13659
		if ( work2[7] == '-' )
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13660
		    strncpy( work, &work2[8], ( strlen( work2) - 8) );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13661
	    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13662
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13663
	if (strncmp( work, "underline", 9 ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13664
	    fdwUnderline = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13665
	    if( work[10] == '-' )
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13666
		strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13667
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13668
	if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13669
	    fdwStrikeOut = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13670
	}
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13671
    }
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13672
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13673
    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
 13674
		faceName, nHeight, nWidth, fnWeight));
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13675
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13676
    hFont = CreateFont(
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13677
			(
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13678
			    (heightIsCellHeight == true)  ?
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13679
				nHeight : -nHeight            /* positive:cell height; negative:character height */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13680
			),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13681
			nWidth,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13682
			nEscapement,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13683
			nOrientation,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13684
			fnWeight,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13685
			fdwItalic,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13686
			fdwUnderline,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13687
			fdwStrikeOut,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13688
			fdwCharSet,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13689
			fdwOutputPrecision,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13690
			fdwClipPrecision,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13691
			fdwQuality,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13692
			fdwPitchAndFamily,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13693
			faceName );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13694
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13695
    if (hFont != NULL) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13696
	DPRINTF(("createFont: %x\n", hFont));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13697
#ifdef COUNT_RESOURCES
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13698
	__cnt_font++;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13699
	RES1PRINTF(("CreateFont %d\n", __cnt_font));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13700
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13701
	RETURN ( __MKOBJ(hFont) );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13702
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13703
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13704
    DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13705
%}.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13706
    ^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13707
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13708
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13709
     Display getFontWithFoundry:'*'
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13710
			 family:'courier'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13711
			 weight:'medium'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13712
			  slant:'r'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13713
			spacing:nil
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13714
		      pixelSize:nil
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13715
			   size:13
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13716
		       registry:'iso8859'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13717
		       encoding:#*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13718
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13719
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13720
    "new NT Version: 20.2.1997 / 22:33:29 / dq"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13721
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13722
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13723
getLogicalPixelSizeY
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13724
%{
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13725
    RETURN( __MKSMALLINT(__logPixelSY) );
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13726
%}
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13727
!
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13728
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13729
listOfAvailableFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13730
    "return a list with all available fonts on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13731
     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
 13732
     next time. The elements of the returned collection are instances of
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13733
     FontDescription."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13734
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13735
    |list typeFaceList|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13736
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13737
    listOfFonts notNil ifTrue:[^ listOfFonts].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13738
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13739
    list := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13740
    typeFaceList := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13741
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13742
    [
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13743
      self primEnumFontTypesInto:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13744
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13745
      "/Transcript showCR:typeFaceList.
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
      typeFaceList do:[:typeFace |
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13748
	  self primEnumFontsIn:typeFace into:list.
2000
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
    ] valueUninterruptably.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13751
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13752
    "/ Transcript showCR:list.
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13753
    listOfFonts := OrderedCollection new.
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13754
    list do:[:anInfoArray |
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13755
	| fntDescr italicFontDescr |
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13756
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13757
	fntDescr := self fontDescriptionFromLogicalFontInfoArray:anInfoArray.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13758
	listOfFonts add:fntDescr.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13759
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13760
	"/ 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
 13761
	(fntDescr style startsWith:'roman') ifTrue:[
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13762
	    italicFontDescr := FontDescription
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13763
			    family:fntDescr family
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13764
			    face:fntDescr face
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13765
			    style:('italic' , (fntDescr style copyFrom:'roman' size+1))
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13766
			    size:fntDescr size
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13767
			    encoding:fntDescr encoding.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13768
	    listOfFonts add:italicFontDescr.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13769
	].
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13770
    ].
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13771
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13772
    ^ listOfFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13773
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13774
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13775
     Display listOfAvailableFonts.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13776
     Display getAvailableFontsMatching:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13777
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13778
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13779
    "Modified: 27.9.1995 / 10:54:47 / stefan"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13780
    "Modified: 17.4.1996 / 15:27:57 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13781
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13782
5175
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13783
pixelSizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filterBlock
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13784
    "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
 13785
     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
 13786
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13787
    |sizes|
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13788
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13789
    sizes := super pixelSizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filterBlock.
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13790
    (sizes notNil and:[sizes includes:0]) ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13791
	"special: size 0 means:
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13792
	 there are scaled versions in all sizes available"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13793
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13794
	^ #(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
 13795
    ].
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13796
    ^ sizes
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13797
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13798
    "
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13799
     Display pixelSizesInFamily:'courier' face:'bold' style:'roman'
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13800
    "
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13801
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13802
    "Created: 27.2.1996 / 01:38:15 / cg"
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
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13805
primEnumFontTypesInto:typeFaceList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13806
%{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13807
    if (__tmpDC) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13808
#ifdef USE_EnumFontFamiliesEx
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 13809
	EnumFontFamiliesEx( __tmpDC, NULL, EnumFPTypeFaceProc, (INT)&typeFaceList);
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 13810
#else
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 13811
	EnumFontFamilies( __tmpDC, NULL, EnumFPTypeFaceProc, (INT)&typeFaceList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13812
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13813
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13814
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13815
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13816
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13817
primEnumFontsIn:typeFace into:fontList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13818
%{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13819
    char *cp;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13820
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13821
    if (__isStringLike(typeFace)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13822
	if (__tmpDC) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13823
#ifdef USE_EnumFontFamiliesEx
7614
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
 13824
	    EnumFontFamiliesEx(__tmpDC, __stringVal(typeFace), EnumFontsProc, (INT)&fontList);
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
 13825
#else
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
 13826
	    EnumFontFamilies(__tmpDC, __stringVal(typeFace), EnumFontsProc, (INT)&fontList);
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13827
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13828
	}
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13829
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13830
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13831
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13832
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13833
primFontMetricsOf:fontId intoArray:rawData
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13834
    "evaluate aBlock, passing a fonts metrics as arguments.
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13835
     fill passed array as:
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13836
      ascent     -> (data at:1)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13837
      descent    -> (data at:2)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13838
      maxAscent  -> (data at:3)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13839
      maxDescent -> (data at:4)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13840
      minWidth   -> (data at:5)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13841
      maxWidth   -> (data at:6)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13842
      avgWidth   -> (data at:7).
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13843
      minChar    -> (data at:8).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13844
      maxChar    -> (data at:9).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13845
      defaultChar-> (data at:10).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13846
      charSet    -> (data at:11).
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13847
"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13848
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13849
%{
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13850
    if (__isExternalAddress(fontId)
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13851
     && __isArray(rawData)
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13852
     && (__arraySize(rawData) >= 11)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13853
	SIZE size;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13854
	int avgWidth;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13855
	HGDIOBJ hFont;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13856
	HGDIOBJ prevFont;
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 13857
	// TEXTMETRIC tmet;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 13858
	TEXTMETRICW tmet;
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13859
	OBJ t;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13860
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13861
	hFont = _HGDIOBJVal(fontId);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13862
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13863
	/*
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13864
	 * 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
 13865
	 */
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13866
#ifdef CACHE_LAST_TMP_FONT
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13867
	if (__tmpDC_hfont != hFont) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13868
	    prevFont = SelectObject(__tmpDC, hFont);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13869
	    if (__tmpDC_prev_hfont == NULL) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13870
		__tmpDC_prev_hfont = prevFont;
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
	    __tmpDC_hfont = hFont;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13873
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13874
#else
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13875
	prevFont = SelectObject(__tmpDC, hFont);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13876
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13877
	GetTextMetricsW(__tmpDC, &tmet);
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13878
#if 0
5596
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
	    static char *s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13881
	    static int len;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13882
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13883
	    if (len == 0) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13884
		len = strlen(s);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13885
	    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13886
	    GetTextExtentPoint32(__tmpDC, s, len, &size);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13887
	    avgWidth = (size.cx / (len / 2) + 1) / 2;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13888
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13889
#else
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13890
	avgWidth = tmet.tmAveCharWidth;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13891
#endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13892
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13893
#ifndef CACHE_LAST_TMP_FONT
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13894
	SelectObject(__tmpDC, prevFont);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13895
#endif
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
	__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
 13898
	__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
 13899
	__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
 13900
	__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
 13901
	__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
 13902
	__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
 13903
	__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
 13904
	__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
 13905
	__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
 13906
	__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
 13907
	t = __charSetSymbolFor(tmet.tmCharSet);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13908
	__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
 13909
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13910
	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
 13911
		    hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13912
		    tmet.tmAveCharWidth));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13913
	RETURN (self);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13914
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13915
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13916
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13917
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13918
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13919
releaseFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13920
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13921
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13922
    if (__isExternalAddress(aFontId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13923
	HGDIOBJ hFont = _HGDIOBJVal(aFontId);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 13924
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 13925
	if (hFont) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13926
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13927
	    __cnt_font--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13928
	   RES1PRINTF(("DestroyFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13929
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13930
	   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
 13931
	   _DeleteFont(hFont, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13932
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13933
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13934
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13935
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13936
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13937
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13938
    "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
 13939
     on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13940
     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
 13941
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13942
    |sizes|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13943
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13944
    sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13945
    (sizes notNil and:[sizes includes:0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13946
	"special: in X11R5 and above, size 0 means:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13947
	 there are scaled versions in all sizes available"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13948
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13949
	^ #(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
 13950
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13951
    ^ sizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13952
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13953
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13954
     Display sizesInFamily:'courier' face:'bold' style:'roman'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13955
    "
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
    "Created: 27.2.1996 / 01:38:15 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13958
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13959
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13960
widthOf:aString from:index1 to:index2 inFont:aFontId
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13961
    "leftover - bw compatibility"
6040
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13962
    |w|
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13963
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13964
    w := self
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13965
	widthOf:aString from:index1 to:index2 inFont:aFontId
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13966
	in:nil with:nil.
6040
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13967
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13968
    w isNil ifTrue:[
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13969
	"/ the primitive returns nil (sigh) for invalid argument
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13970
	w := self
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13971
	    widthOf:aString asString asUnicode16String from:index1 to:index2 inFont:aFontId
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13972
	    in:nil with:nil
6040
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13973
    ].
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13974
    ^ w
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13975
!
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13976
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13977
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
 13978
%{  /* NOCONTEXT */
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13979
    unsigned char *cp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13980
    int len, n, i1, i2, l;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13981
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13982
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13983
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13984
    if (__bothSmallInteger(index1, index2)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13985
     && __isExternalAddress(aFontId)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13986
     && __isNonNilObject(aString)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13987
	HGDIOBJ hFont,prevFont;
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13988
	HDC hDC;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13989
	SIZE tsize;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13990
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 13991
#define xxPRE_22_FEP_2007
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13992
#ifndef PRE_22_FEP_2007
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13993
#       define N_QUICK_CHARS    1024
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13994
	unsigned short quickWchars[N_QUICK_CHARS];
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13995
	unsigned short *wcharPtr;
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13996
	int mustFree = 0;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13997
	int i;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13998
#endif
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13999
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14000
	hFont = _HGDIOBJVal(aFontId);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14001
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14002
	if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14003
	    struct gcData *gcData = _GCDATA(aGCId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14004
	    hDC = _getDC(gcData);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14005
	    prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14006
	} else {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14007
	    hDC = __tmpDC;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14008
#ifdef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14009
	    if (__tmpDC_hfont != hFont) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14010
		prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14011
		if (__tmpDC_prev_hfont == NULL) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14012
		    __tmpDC_prev_hfont = prevFont;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14013
		}
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14014
		__tmpDC_hfont = hFont;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14015
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14016
#else
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14017
	    prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14018
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14019
	}
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14020
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14021
	i1 = __intVal(index1) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14022
	cls = __qClass(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14023
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14024
	if (i1 >= 0) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14025
	    i2 = __intVal(index2) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14026
	    if (i2 < i1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14027
		RETURN ( __MKSMALLINT( 0 ) );
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14028
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14029
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14030
	    cp = (char *) _stringVal(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14031
	    l = i2 - i1 + 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14032
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 14033
	    if (__isStringLike(aString)) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14034
		n = _stringSize(aString);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14035
    commonWidthChars:
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14036
		if (i2 < n) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14037
		    cp += i1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14038
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14039
#ifdef PRE_22_FEP_2007
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14040
		    GetTextExtentPoint32(hDC, cp, l, &tsize);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14041
#else
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14042
		    if (l <= N_QUICK_CHARS) {
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14043
			wcharPtr = quickWchars;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14044
			mustFree = 0;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14045
		    } else {
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14046
			wcharPtr = malloc(sizeof(short)*l);
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14047
			if (! wcharPtr) RETURN (__MKSMALLINT(0));
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14048
			mustFree = 1;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14049
		    }
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 14050
		    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
 14051
		    GetTextExtentPoint32W(hDC, wcharPtr, l, &tsize);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14052
		    if (mustFree) free(wcharPtr);
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14053
#endif
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14054
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14055
#ifdef SUPERDEBUG
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14056
		    if (__debug__) {
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14057
			char buf[80];
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14058
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14059
			GetTextFace(hDC,80,buf);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14060
			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
 14061
		    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14062
#endif
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14063
		    if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14064
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14065
		    } else {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14066
#ifndef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14067
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14068
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14069
		    }
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14070
		    RETURN ( __MKSMALLINT(tsize.cx) );
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14071
		}
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14072
		RETURN (__MKSMALLINT(0));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14073
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14074
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14075
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14076
	    cp += nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14077
	    n = __byteArraySize(aString) - nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14078
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14079
	    if (__isBytes(aString)) {
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14080
		goto commonWidthChars;
3494
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
	    /* Unicode */
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14084
	    if (__isWords(aString)) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14085
		n = n / 2;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14086
		if (i2 < n) {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14087
		    WIDECHAR *w_cp = (WIDECHAR *)cp;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14088
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14089
		    w_cp += i1;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14090
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14091
		    GetTextExtentPoint32W(hDC, w_cp, l, &tsize);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14092
		    if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14093
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14094
		    } else {
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14095
#ifndef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14096
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14097
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14098
		    }
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14099
		    RETURN ( __MKSMALLINT(tsize.cx) );
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14100
		}
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14101
		RETURN (__MKSMALLINT(0));
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14102
	    }
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14103
	}
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14104
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14105
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14106
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14107
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14108
4511
4430c632995a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4504
diff changeset
 14109
!WinWorkstation methodsFor:'grabbing'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14110
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14111
allowEvents:mode
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14112
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14113
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14114
grabKeyboardIn:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14115
    "grab the keyboard"
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14116
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14117
#ifdef NOT_YET_IMPLEMENTED
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14118
    if (__isExternalAddress(aWindowId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14119
      HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14120
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14121
      CPRINTF(("grabKeyboard in %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14122
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14123
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14124
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14125
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14126
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14127
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14128
    "grap the pointer - return true if ok"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14129
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14130
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14131
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14132
	HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14133
	HCURSOR hCursor = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14134
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14135
	if (__currentCapture != CAPTURE_NONE) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14136
	    PostMessage(__currentPointerView, WM_THREAD_SETCAPTURE, 0, 0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14137
	    //ReleaseCapture();
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14138
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14139
#if 1
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14140
	/*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14141
	 * place a special, invisible view above the root
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14142
	 */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14143
	if (hWnd == __rootWin) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14144
	    hWnd = __rootWinSpezial;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14145
	    ShowWindow(hWnd, SW_SHOWNOACTIVATE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14146
	    //EnableWindow(hWnd,TRUE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14147
	    SetWindowPos(hWnd, HWND_TOP,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14148
			 0, 0, 0, 0,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14149
			 SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14150
			 | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14151
	    CPRINTF(("setRootCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14152
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14153
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14154
	if (__isExternalAddress(aCursorId)) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14155
	    hCursor = _HCURSORVal(aCursorId);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14156
	    CPRINTF(("grabPointerIn  SetCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14157
	}
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14158
	PostMessage(hWnd, WM_THREAD_SETCAPTURE, (INT)hWnd, (INT)hCursor);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14159
	RETURN (true);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14160
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14161
%}.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14162
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14163
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14164
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14165
ungrabKeyboard
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14166
    "release the keyboard"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14167
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14168
    activeKeyboardGrab := nil.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14169
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14170
#ifdef NOT_YET_IMPLEMENTED
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14171
    CPRINTF(("ungrabKeyboard\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14172
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14173
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14174
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14175
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14176
ungrabPointer
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14177
    "release the pointer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14178
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14179
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14180
    CPRINTF(("ungrabPointer 1\n"));
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14181
    PostThreadMessage(_dispatchThreadId, WM_THREAD_SETCAPTURE, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14182
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14183
    activePointerGrab := nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14184
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14185
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14186
!WinWorkstation methodsFor:'graphic context stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14187
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14188
noClipIn:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14189
    "disable clipping rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14190
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14191
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14192
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14193
    if (__isExternalAddress(aWindowId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14194
     && __isExternalAddress(aGCId)) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14195
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14196
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14197
	if (gcData->clipping != FALSE) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14198
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14199
	    GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14200
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14201
	    gcData->clipping = FALSE;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14202
#ifdef CACHE_LAST_DC
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 14203
	    if (lastGcData == gcData) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14204
		SelectClipRgn(gcData->_hDC, NULL);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 14205
	    }
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 14206
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14207
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14208
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14209
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14210
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14211
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14212
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14213
setBackground:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14214
    "set background color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14215
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14216
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14217
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14218
    if (__isSmallInteger(bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14219
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14220
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14221
	COLORREF bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14222
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14223
	bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14224
	if (bgColor != gcData->bgColor) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14225
	    gcData->bgColor = bgColor;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14226
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14227
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14228
		SetBkColor(gcData->_hDC, bgColor);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14229
		/*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14230
		 * no need to flush pen - it does not depend upon
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14231
		 * the bg color
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14232
		 */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14233
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14234
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14235
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14236
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14237
	CPRINTF(("setBackground: %x\n", bgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14238
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14239
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14240
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14241
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14242
    ^self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14243
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14244
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14245
setBitmapMask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14246
    "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
 14247
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14248
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14249
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14250
    if (__isExternalAddress(aGCId)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14251
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14252
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14253
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14254
	oldM = gcData->hMask;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14255
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14256
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14257
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14258
	    gcData->hMask = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14259
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14260
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14261
	    FLUSH_CACHED_DC(gcData);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 14262
	    CPRINTF(("masks set to %x\n",gcData->hMask));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14263
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14264
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14265
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14266
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14267
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14268
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 14269
setClipByChildren:aBool in:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14270
    "enable/disable drawing into child views"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14271
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14272
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14273
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14274
    if (ISCONNECTED && __isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14275
	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
 14276
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14277
	if (gcData && gcData->hWnd) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14278
	    int newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14279
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14280
	   newClip = (aBool == true) ? TRUE : FALSE;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14281
	    if (newClip != gcData->clipByChildren) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14282
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14283
		GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14284
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14285
		/* set/clear clip by children */
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14286
		gcData->clipByChildren = newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14287
		FLUSH_CACHED_DC(gcData);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14288
	    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 14289
	} else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14290
	    DPRINTF(("clipping by child failed - invalid window\n" ));
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 14291
	}
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 14292
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14293
%}.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14294
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14295
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14296
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 14297
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
 14298
    "clip to a rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14299
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14300
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14301
      p--w---
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14302
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14303
      h     |  the clipping rectangle
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14304
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14305
      -------
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 14306
	  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
 14307
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14308
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14309
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14310
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14311
    if (  __isExternalAddress(aGCId)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 14312
       && __bothSmallInteger(clipXArg, clipYArg)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14313
       && __bothSmallInteger(clipWidth, clipHeight) ) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14314
	struct gcData *gcData = _GCDATA(aGCId);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14315
	int cX, cY, cW, cH;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14316
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 14317
	cX = __intVal(clipXArg);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 14318
	cY = __intVal(clipYArg);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14319
	cW = __intVal(clipWidth);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14320
	cH = __intVal(clipHeight);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14321
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14322
	if ((gcData->clipping != TRUE)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14323
	 || (cX != gcData->clipX)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14324
	 || (cY != gcData->clipY)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14325
	 || (cW != gcData->clipW)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14326
	 || (cH != gcData->clipH)) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14327
	    gcData->clipping = TRUE;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14328
	    gcData->clipX = cX;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14329
	    gcData->clipY = cY;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14330
	    gcData->clipW = cW;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14331
	    gcData->clipH = cH;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14332
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14333
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14334
	    GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14335
#endif
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14336
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14337
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14338
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14339
	     */
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14340
	    if (lastGcData == gcData) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14341
		HRGN region = CreateRectRgn(cX, cY, cX + cW, cY + cH);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14342
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14343
		if (region == NULL ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14344
		    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
 14345
		    FLUSH_CACHED_DC(gcData);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14346
		} else {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14347
		    if (SelectClipRgn(gcData->_hDC, region) == ERROR ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14348
			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
 14349
			FLUSH_CACHED_DC(gcData);
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
		    _DeleteObject(region, __LINE__);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14352
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14353
	    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14354
#endif
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14355
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14356
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14357
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14358
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14359
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14360
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14361
setDashes:dashList dashOffset:offset in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14362
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14363
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14364
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14365
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14366
    if (__isExternalAddress(aGCId)) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14367
	PRINTF(("WinWorkstat [warning]: dashes not (yet) implemented\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14368
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14369
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14370
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14371
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14372
setFont:aFontId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14373
    "set font to be drawn in"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14374
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14375
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14376
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14377
    if (__isExternalAddress(aGCId)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14378
     && __isExternalAddress(aFontId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14379
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14380
	struct gcData *gcData = _GCDATA(aGCId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14381
	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
 14382
	// TEXTMETRIC tmet;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14383
	TEXTMETRICW tmet;
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
	hFont = _HGDIOBJVal(aFontId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14386
	if (gcData->hFont != hFont) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14387
	    gcData->hFont = hFont;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14388
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14389
#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
 14390
	    if (__tmpDC_hfont != hFont) {
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14391
		prevFont = SelectObject(__tmpDC, hFont);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14392
		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
 14393
		    __tmpDC_prev_hfont = prevFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14394
		}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14395
		__tmpDC_hfont = hFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14396
	    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14397
#else
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14398
	    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
 14399
#endif
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14400
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14401
	    GetTextMetricsW(__tmpDC, &tmet);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14402
	    gcData->fontAscent = tmet.tmAscent;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14403
#ifdef SUPERDEBUG
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14404
	    if (__debug__) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14405
		char buf[80];
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14406
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14407
		GetTextFace(__tmpDC, 80, buf);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14408
		PRINTF(("setFont: %x %s\n", hFont, buf));
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14409
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14410
#endif
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14411
#ifndef CACHE_LAST_TMP_FONT
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14412
	    SelectObject(__tmpDC, prevFont);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14413
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14414
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14415
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14416
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14417
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14418
	     */
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14419
	    if (lastGcData == gcData) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14420
		prevFont = SelectObject(gcData->_hDC, hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14421
		if (! gcData->save_hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14422
		    gcData->save_hFont = prevFont;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14423
		}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14424
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14425
#endif
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14426
	    RETURN ( self );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14427
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14428
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14429
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14430
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14431
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14432
setForeground:fgColorIndex background:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14433
    "set foreground and background colors to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14434
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14435
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14436
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14437
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14438
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14439
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14440
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14441
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14442
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14443
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14444
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14445
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14446
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14447
	if ((fg != oldFg) || (bg != oldBg)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14448
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14449
	    gcData->bgColor = bg;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14450
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14451
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14452
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14453
	     * must update or flush current cached DC
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 (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14456
		/* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14457
		if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14458
		    SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14459
		    FLUSH_CACHED_PEN(gcData);
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
		if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14462
		    SetBkColor(gcData->_hDC, bg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14463
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14464
		FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14465
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14466
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14467
	    CPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
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
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14470
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14471
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14472
    ^self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14473
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14474
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14475
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14476
    "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
 14477
     solid (if aBitmapId is nil)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14478
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14479
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14480
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14481
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14482
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14483
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14484
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14485
	HBITMAP m, oldM;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14486
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14487
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14488
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14489
	if (__isExternalAddress(aBitmapId))
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14490
	    m = _HBITMAPVAL(aBitmapId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14491
	else
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14492
	    m = 0;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14493
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14494
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14495
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14496
	oldM = gcData->hMask;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14497
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14498
	if ((oldFg != fg) || (oldBg != bg) || (oldM != m)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14499
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14500
	    gcData->bgColor = bg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14501
	    gcData->hMask = m;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14502
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14503
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14504
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14505
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14506
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14507
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14508
		if (oldM == m) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14509
		    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14510
		     * only fg/bg changed
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14511
		     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14512
		    /* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14513
		    if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14514
			SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14515
			FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14516
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14517
		    if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14518
			SetBkColor(gcData->_hDC, bg);
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
		    FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14521
		} else {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14522
		    _releaseDC(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14523
		}
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
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14526
	    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
 14527
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14528
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14529
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14530
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14531
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14532
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14533
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14534
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14535
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
 14536
    "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
 14537
     solid (if aBitmapId is nil); also set lineWidth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14538
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14539
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14540
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14541
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14542
	&& __isSmallInteger(aLineWidth)
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14543
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14544
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14545
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14546
	HBITMAP m, oldM;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14547
	int lw, oldLw;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14548
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14549
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14550
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14551
	if (__isExternalAddress(aBitmapId))
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14552
	    m = _HBITMAPVAL(aBitmapId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14553
	else
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14554
	    m = 0;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14555
	lw = __intVal(aLineWidth);
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
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14558
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14559
	oldLw = gcData->lineWidth;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14560
	oldM = gcData->hMask;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14561
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14562
	if ((oldFg != fg) || (oldBg != bg)
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14563
	 || (oldLw != lw) || (oldM != m)) {
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
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14566
	    gcData->bgColor = bg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14567
	    gcData->lineWidth = lw;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14568
	    gcData->hMask = m;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14569
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14570
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14571
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14572
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14573
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14574
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14575
		if ((oldM == m) && (oldLw == lw)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14576
		    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14577
		     * only fg/bg changed
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14578
		     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14579
		    /* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14580
		    if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14581
			SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14582
			FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14583
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14584
		    if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14585
			SetBkColor(gcData->_hDC, bg);
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
		    FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14588
		} else {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14589
		    _releaseDC(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14590
		}
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
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14593
	    CPRINTF(("setForeground: %x background: %x mask: %x linewidth: %d\n",
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14594
			gcData->fgColor, gcData->bgColor,
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14595
			gcData->hMask, gcData->lineWidth));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14596
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14597
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14598
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14599
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14600
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14601
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14602
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14603
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14604
setForeground:fgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14605
    "set foreground color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14606
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14607
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14608
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14609
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14610
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14611
    if (__isSmallInteger(fgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14612
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14613
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14614
	COLORREF fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14615
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14616
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14617
	if (fg != gcData->fgColor) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14618
	    gcData->fgColor = fg;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14619
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14620
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14621
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14622
	     * must update or flush current cached DC
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
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14625
		/* Pen depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14626
		SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14627
		FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14628
		FLUSH_CACHED_BRUSH(gcData);
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
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14631
	    CPRINTF(("setForeground: %x\n", gcData->fgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14632
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14633
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14634
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14635
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14636
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14637
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14638
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14639
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14640
setFunction:aFunctionSymbol in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14641
    "set alu function to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14642
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14643
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14644
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14645
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14646
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14647
	int fun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14648
	int bfun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14649
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14650
	if (aFunctionSymbol == @symbol(copy)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14651
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14652
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14653
	} else if (aFunctionSymbol == @symbol(copyInverted)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14654
	    fun = R2_NOTCOPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14655
	    bfun = BITBLT_COPYINVERTED;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14656
	} else if (aFunctionSymbol == @symbol(xor)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14657
	    fun = R2_XORPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14658
	    bfun = BITBLT_XOR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14659
	} else if (aFunctionSymbol == @symbol(and)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14660
	    fun = R2_MASKPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14661
	    bfun = BITBLT_AND;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14662
	} else if (aFunctionSymbol == @symbol(or)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14663
	    fun = R2_MERGEPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14664
	    bfun = BITBLT_OR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14665
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14666
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14667
	if (fun != -1) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14668
#if 0
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14669
	    console_printf("set func to");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14670
	    switch (bfun) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14671
		case BITBLT_COPY:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14672
		    console_printf("BITBLT_COPY\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14673
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14674
		case BITBLT_COPYINVERTED:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14675
		    console_printf("BITBLT_COPYINVERTED\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14676
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14677
		case BITBLT_XOR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14678
		    console_printf("BITBLT_XOR\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14679
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14680
		case BITBLT_AND:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14681
		    console_printf("BITBLT_AND\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14682
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14683
		case BITBLT_OR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14684
		    console_printf("BITBLT_OR\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14685
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14686
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14687
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14688
	} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14689
	    INFOFPRINTF( (stderr, "WinWorkstat [warning]: unsuported Rasterfunction\n") );
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14690
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14691
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14692
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14693
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14694
	if ((fun != gcData->rop2)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14695
	 || (bfun != gcData->bitbltrop2)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14696
	    gcData->rop2 = fun;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14697
	    gcData->bitbltrop2 = bfun;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14698
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14699
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14700
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14701
	     */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14702
	    if (gcData == lastGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14703
		SetROP2(gcData->_hDC, fun);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14704
	    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14705
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14706
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14707
    } else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14708
	INFOFPRINTF((stderr, "WinWorkstation [warning]: Rasterfunction no GC\n"));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14709
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14710
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14711
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14712
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14713
setGraphicsExposures:aBoolean in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14714
    "set or clear the graphics exposures flag"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14715
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14716
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14717
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14718
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14719
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14720
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14721
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14722
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14723
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14724
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14725
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14726
     && __isSmallInteger(aNumber)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14727
	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
 14728
	int style;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14729
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14730
	gcData->lineWidth = __intVal(aNumber);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14731
	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
 14732
	    style = PS_SOLID;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14733
	} 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
 14734
	    style= PS_DASH;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14735
	} 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
 14736
	    style= PS_DOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14737
	} 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
 14738
	    style= PS_DASHDOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14739
	} 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
 14740
	    style= PS_DASHDOTDOT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14741
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14742
	    style= PS_SOLID;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14743
	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
 14744
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14745
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14746
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14747
	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
 14748
	    style = PS_ENDCAP_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14749
	} 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
 14750
	    style = PS_ENDCAP_SQUARE;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14751
	} 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
 14752
	    style = PS_ENDCAP_FLAT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14753
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14754
	    style = PS_ENDCAP_FLAT;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14755
	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
 14756
	gcData->lStyle |= style;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14757
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14758
	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
 14759
	    style = PS_JOIN_BEVEL;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14760
	} 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
 14761
	    style = PS_JOIN_MITER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14762
	} 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
 14763
	    style = PS_JOIN_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14764
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14765
	    style = PS_JOIN_MITER;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14766
	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
 14767
	gcData->lStyle |= style;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14768
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14769
	FLUSH_CACHED_DC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14770
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14771
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14772
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14773
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14774
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14775
setMaskOriginX:orgX y:orgY in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14776
    "set the mask origin"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14777
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14778
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14779
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14780
    if (__isExternalAddress(aGCId)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14781
     && __bothSmallInteger(orgX,orgY)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14782
	struct gcData *gcData = _GCDATA(aGCId);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14783
	int oX, oY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14784
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14785
	oX = __intVal(orgX);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14786
	oY = __intVal(orgY);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14787
	if ((oX != gcData->maskOrgX)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14788
	 || (oY != gcData->maskOrgY)) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14789
	    gcData->maskOrgX = __intVal(orgX);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14790
	    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
 14791
	    FLUSH_CACHED_DC(gcData);
2420
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
	RETURN (self);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14794
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14795
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14796
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14797
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14798
setPixmapMask:aPixmapId in:aGCId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14799
    "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
 14800
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14801
%{  /* NOCONTEXT */
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14802
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14803
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14804
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14805
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14806
	oldM = gcData->hMask;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14807
	if (__isExternalAddress(aPixmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14808
	    gcData->hMask = _HBITMAPVAL(aPixmapId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14809
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14810
	    gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14811
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14812
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14813
	    FLUSH_CACHED_DC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14814
	    DPRINTF(("PixmapMasks set to %x\n",gcData->hMask));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14815
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14816
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14817
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14818
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14819
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14820
5671
e8f727199c80 category of:12 methods
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
 14821
!WinWorkstation methodsFor:'initialization & release'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14822
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14823
closeConnection
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14824
    "close down the connection to the display"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14825
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14826
"/    Processor disableSemaphore:eventSema
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
3832
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 14829
initializeDefaultKeyboardMappingsIn:aKeyboardMap
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14830
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14831
    #(
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14832
	Copy            Ctrlc           "copy selection to buffer"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14833
	Cut             Ctrlx           "cut selection into buffer"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14834
	Paste           Ctrlv           "paste buffer or external selection"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14835
	UserAbort       CtrlCancel      "Abort window process"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14836
	UserInterrupt   Pause           "interrupt window process"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14837
	$0              KeyPad0         "NumLocked numeric keypad keys..."
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14838
	$1              KeyPad1
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14839
	$2              KeyPad2
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14840
	$3              KeyPad3
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14841
	$4              KeyPad4
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14842
	$5              KeyPad5
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14843
	$6              KeyPad6
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14844
	$7              KeyPad7
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14845
	$8              KeyPad8
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14846
	$9              KeyPad9
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14847
    ) pairWiseDo:[:eachMapping :eachKey|
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14848
	    aKeyboardMap
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14849
		bindValue:eachMapping to:eachKey.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14850
	].
5108
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14851
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14852
    "
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14853
     Screen default initializeDefaultKeyboardMappingsIn:Screen default keyboardMap
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14854
    "
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 14855
!
3832
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 14856
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14857
initializeDefaultValues
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14858
    focusMode := #activeWindow.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14859
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14860
"/    self activateOnClick:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14861
"/    self ignoreButtonPressOnActivate:false.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14862
"/    self rightButtonIsLowerWindow:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14863
"/    self shiftedLeftButtonIsLowerWindow:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14864
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14865
    buttonTranslation := ButtonTranslation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14866
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14867
    self initializeModifierMappings
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14868
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14869
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14870
initializeDevice
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14871
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14872
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14873
    int scr;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14874
    int maxRGBDepth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14875
    int rgbRedMask, rgbGreenMask, rgbBlueMask;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14876
    int nvi, i;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14877
    char *type, *nm;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14878
    int dummy;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14879
    int mask, shift, nBits;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14880
    HDC _rootDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14881
    OBJ id;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14882
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14883
    if (firstInstance) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14884
	OSVERSIONINFO osvi;
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14885
	WNDCLASSW wc_stx;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14886
	WNDCLASSW wc_root;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14887
	WNDCLASSW wc_popup;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14888
	WNDCLASSW wc_dialog;
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14889
	firstInstance = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14890
	DPRINTF(("first create - registerClass\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14891
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14892
	memset(&osvi, 0, sizeof(OSVERSIONINFO));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14893
	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14894
	GetVersionEx (&osvi);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14895
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14896
	switch (osvi.dwMajorVersion) {
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 14897
	    default:
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 14898
		// defaults to the newest version we know about
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 14899
		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
 14900
		// fall into
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14901
	    case 6:
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 14902
		// vista, win7, win8
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14903
		__isWinXP = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14904
		__isWinVista = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14905
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14906
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14907
	    case 5:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14908
		// 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
 14909
		switch (osvi.dwMinorVersion) {
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14910
		    default:
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14911
		    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
 14912
		    case 1:         // windows xp
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14913
			__isWinXP = 1;
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14914
			break;
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14915
		    case 0:
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14916
			__isWin2k = 1;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14917
		}
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14918
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14919
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14920
	    // no longer supported
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14921
	    case 4:   // nt4.0
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14922
	    case 3:   // nt3.51
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14923
	    case 2:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14924
	    case 1:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14925
	    case 0:
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14926
		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
 14927
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14928
	}
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14929
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14930
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14931
	 * register class: ST/X
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14932
	 */
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14933
	wc_stx.style = 0
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14934
		   /* | CS_OWNDC */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14935
		   /* | CS_HREDRAW */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14936
		   /* | CS_VREDRAW */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14937
		  | CS_DBLCLKS;
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14938
	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
 14939
	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
 14940
	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
 14941
	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
 14942
	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
 14943
	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
 14944
	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
 14945
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14946
	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
 14947
	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
 14948
	RegisterClassW( (&wc_stx) );
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14949
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14950
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14951
	 * register class: ST/X:Root
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14952
	 */
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14953
	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
 14954
	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
 14955
	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
 14956
	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
 14957
	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
 14958
	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
 14959
	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
 14960
	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
 14961
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14962
	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
 14963
	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
 14964
	RegisterClassW( (CONST WNDCLASSW *)(&wc_root) );
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14965
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14966
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14967
	 * register class: ST/X:Popup
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14968
	 */
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14969
	wc_popup.style = CS_SAVEBITS;
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14970
	if (__isWinXP) {
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14971
#ifndef CS_DROPSHADOW
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14972
# define CS_DROPSHADOW    0x020000
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14973
#endif
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14974
	    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
 14975
	}
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14976
	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
 14977
	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
 14978
	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
 14979
	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
 14980
	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
 14981
	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
 14982
	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
 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.lpszMenuName =  NULL;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14985
	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
 14986
	RegisterClassW( (CONST WNDCLASSW *)(&wc_popup) );
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14987
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14988
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14989
	 * register class: ST/X:Dialog
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14990
	 */
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14991
	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
 14992
	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
 14993
	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
 14994
	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
 14995
	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
 14996
	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
 14997
	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
 14998
	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
 14999
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15000
	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
 15001
	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
 15002
	RegisterClassW( (CONST WNDCLASSW *)(&wc_dialog) );
5072
fcd3884582e0 unicode stuff
Claus Gittinger <cg@exept.de>
parents: 5067
diff changeset
 15003
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15004
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15005
	 * generate my events
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15006
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15007
	hDispatchThreadRunningEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15008
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15009
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15010
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15011
				"DispatchThreadRunning"); /* name of event */
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
	if (hDispatchThreadRunningEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15014
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-0 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15015
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15016
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15017
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15018
	hNeverTriggered = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15019
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15020
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15021
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15022
				"Never");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15023
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15024
	if (hNeverTriggered == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15025
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-1 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15026
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15027
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15028
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15029
	hCreateEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15030
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15031
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15032
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15033
				"CreateEvents"); /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15034
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15035
	if (hCreateEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15036
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-2 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15037
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15038
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15039
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15040
	hInputEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15041
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15042
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15043
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15044
				"InputEvents");  /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15045
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15046
	if (hInputEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15047
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-3 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15048
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15049
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15050
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15051
	if (hEventsMutex) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15052
	    console_fprintf(stderr, "WinWorkstation [fatal]: hEventsMutex already created\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15053
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15054
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15055
	hEventsMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15056
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15057
				FALSE,           /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15058
				"EventsMutex");  /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15059
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15060
	if (! hEventsMutex) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15061
	    console_fprintf(stderr, "WinWorkstation [fatal]: hEventsMutex failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15062
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15063
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15064
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15065
			hEventsMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15066
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15067
			&hEventsMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15068
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15069
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15070
			DUPLICATE_SAME_ACCESS);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15071
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 15072
#ifdef USE_PAINT_MUTEX
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15073
	hPaintMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15074
				NULL,           /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15075
				FALSE,          /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15076
				"PaintMutex");  /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15077
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15078
	if (hPaintMutex == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15079
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateMutex(PaintMutex) failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15080
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15081
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15082
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15083
			hPaintMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15084
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15085
			&hPaintMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15086
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15087
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15088
			DUPLICATE_SAME_ACCESS);
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 15089
#endif
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 15090
#ifdef USE_DRAW_MUTEX
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15091
	hDrawMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15092
				NULL,           /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15093
				FALSE,          /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15094
				"DrawMutex");   /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15095
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15096
	if (hDrawMutex == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15097
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateMutex(DrawMutex) failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15098
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15099
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15100
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15101
			hDrawMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15102
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15103
			&hDrawMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15104
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15105
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15106
			DUPLICATE_SAME_ACCESS);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15107
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15108
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15109
	_masterThreadId = GetCurrentThreadId();
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
 15110
#ifndef WIN32THREADS
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15111
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15112
			GetCurrentThread(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15113
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15114
			&_masterThread,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15115
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15116
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15117
			DUPLICATE_SAME_ACCESS);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15118
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15119
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15120
	initEventqueue();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15121
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15122
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15123
	 * start the event dispatcher thread and wait for it to
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15124
	 * be ready
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15125
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15126
	CreateThread((LPSECURITY_ATTRIBUTES)0,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15127
		     EVENT_THREAD_STACKSIZE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15128
		     (LPTHREAD_START_ROUTINE)dispatchThread,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15129
		     0, 0, &_dispatchThreadId);
4713
199dbf1a1406 changed #initializeDevice - call CreateThread instead of beginthreadNT
Stefan Vogel <sv@exept.de>
parents: 4712
diff changeset
 15130
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 15131
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15132
	console_fprintf(stderr, "WinWorkstation [info]: dispatchThreadId=%x\n", _dispatchThreadId);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15133
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15134
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15135
	if (WaitForSingleObject(hDispatchThreadRunningEvent, 5000L) != WAIT_OBJECT_0) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15136
	    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
 15137
	}
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 15138
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15139
	console_fprintf(stderr, "WinWorkstation [info]: got ThreadRunningEvent\n");
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 15140
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15141
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15142
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15143
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15144
    __rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15145
    if (!__rootDesk) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15146
	PRINTF(("OpenDesktop fail\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15147
	__rootDesk = CreateDesktop ("Desktop0", NULL, NULL, 0, DESKTOP_WRITEOBJECTS, NULL);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15148
	if (!__rootDesk) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15149
	    PRINTF(("CreateDesktop fail\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15150
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15151
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15152
#endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 15153
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15154
    __rootWin = GetDesktopWindow();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15155
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15156
    id = __MKOBJ(__rootWin);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15157
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15158
    __INST(rootWin) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15159
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15160
    _rootDC = __rootDC = CreateDC("DISPLAY", NULL, NULL, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15161
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15162
    __tmpDC = CreateCompatibleDC(_rootDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15163
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15164
    __nullPen = GetStockObject(NULL_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15165
    __blackPen = GetStockObject(BLACK_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15166
    __whitePen = GetStockObject(WHITE_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15167
    __blackBrush = GetStockObject(BLACK_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15168
    __whiteBrush = GetStockObject(WHITE_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15169
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15170
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15171
    id = __MKOBJ(_rootDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15172
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15173
    __INST(rootDC) = id; __STORE(self, id);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15174
%}.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15175
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15176
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15177
initializeEventBuffer
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15178
    |sz|
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15179
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15180
%{
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15181
    sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15182
%}.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15183
    eventBuffer isNil ifTrue:[
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15184
	eventBuffer := ByteArray new:sz.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15185
    ].
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15186
!
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
initializeFor:aDisplayName
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15189
    "initialize the receiver for a connection to the display;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15190
     the argument, aDisplayName is ignored under Win32.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15191
     (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
 15192
      windows displays ...)"
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
    displayId notNil ifTrue:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 15195
	"/ already connected - trying to trick me ?
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 15196
	^ self
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15197
    ].
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15198
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15199
    displayId := self primInitializeFor:aDisplayName.
3632
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 15200
    displayId isNil ifTrue:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 15201
	self class deviceOpenErrorSignal raiseWith:aDisplayName
3632
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 15202
    ].
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15203
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15204
    dispatching := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15205
    isSlow := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15206
    shiftDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15207
    ctrlDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15208
    metaDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15209
    altDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15210
    motionEventCompression := true.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15211
    buttonsPressed := 0.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15212
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15213
    self initializeScreenProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15214
    self initializeDevice.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15215
    self initializeVariableScreenProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15216
    self initializeVariableSettingsProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15217
    self initializeDeviceResourceTables.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15218
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15219
    self initializeDefaultValues.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15220
    self initializeEventBuffer.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15221
    self initializeSpecialFlags.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15222
    self initializeKeyboardMap.
5708
549499c89f59 delay the stylesheet reading till later
Claus Gittinger <cg@exept.de>
parents: 5672
diff changeset
 15223
    "/ 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
 15224
    "/ self initializeViewStyle.
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15225
!
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
initializeModifierMappings
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15228
    shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15229
    ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl').
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
 15230
    metaModifiers := #(#'Alt_L' #'Alt' #'Menu').
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15231
    altModifiers := #(#'Alt_R').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15232
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15233
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 15234
initializeSpecialFlags
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 15235
    "perform additional special server implementation flags"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 15236
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 15237
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15238
initializeVariableScreenProperties
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 15239
    "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
 15240
     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
 15241
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15242
%{
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15243
    int nvi, i, val, capabilities, planes, numcolors, numpens;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15244
    RECT rect;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15245
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15246
    GetWindowRect(__rootWin, &rect);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15247
    __INST(width) = __MKSMALLINT(rect.right - rect.left);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15248
    __INST(height) = __MKSMALLINT(rect.bottom - rect.top);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15249
    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
 15250
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15251
    __realDepth = GetDeviceCaps(__rootDC, BITSPIXEL);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15252
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15253
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15254
    __depth = 24;  /* its a hack */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15255
#else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15256
    __depth = __realDepth;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15257
    if (__depth == 15)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15258
	__depth = 16;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15259
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15260
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15261
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15262
    numcolors = GetDeviceCaps(__rootDC, NUMCOLORS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15263
    numpens = GetDeviceCaps(__rootDC, NUMPENS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15264
    planes = GetDeviceCaps(__rootDC, PLANES);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15265
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15266
    DPRINTF(("screen has %d planes\n", planes));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15267
    DPRINTF(("numcolors is %d\n", numcolors));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15268
    DPRINTF(("numpens is %d\n", numpens));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15269
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15270
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15271
    __INST(depth) = __MKSMALLINT(__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15272
    __INST(ncells) = __MKSMALLINT(1<<__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15273
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15274
    val = GetDeviceCaps(__rootDC, HORZSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15275
    DPRINTF(("HORSIZE=%d\n",val));
4386
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15276
    if (val > 0) {
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15277
	__INST(widthMM) = __MKSMALLINT(val);
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15278
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15279
    val = GetDeviceCaps(__rootDC, VERTSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15280
    DPRINTF(("VERTSIZE=%d\n",val));
4386
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15281
    if (val > 0) {
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15282
	__INST(heightMM) = __MKSMALLINT(val);
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15283
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15284
    __logPixelSY = GetDeviceCaps(__rootDC, LOGPIXELSY);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15285
    capabilities = GetDeviceCaps(__rootDC, RASTERCAPS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15286
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15287
#ifdef LATER
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15288
    console_printf("device support:\n");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15289
    if (capabilities & RC_BANDING)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15290
	console_printf(" RC_BANDING");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15291
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15292
    if (capabilities & RC_BITBLT)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15293
	console_printf(" RC_BITBLT");
2601
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
    if (capabilities & RC_BITMAP64)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15296
	console_printf(" RC_BITMAP64");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15297
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15298
    if (capabilities & RC_DI_BITMAP)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15299
	console_printf(" RC_DI_BITMAP");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15300
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15301
    if (capabilities & RC_DIBTODEV)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15302
	console_printf(" RC_DIBTODEV");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15303
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15304
    if (capabilities & RC_FLOODFILL)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15305
	console_printf(" RC_FLOODFILL");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15306
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15307
    if (capabilities & RC_PALETTE)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15308
	console_printf(" RC_PALETTE");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15309
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15310
    if (capabilities & RC_SCALING)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15311
	console_printf(" RC_SCALING");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15312
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15313
    if (capabilities & RC_STRETCHBLT)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15314
	console_printf(" RC_STRETCHBLT");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15315
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15316
    if (capabilities & RC_STRETCHDIB)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15317
	console_printf(" RC_STRETCHDIB");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15318
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15319
    console_printf("\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15320
    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
 15321
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15322
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15323
    __INST(whitepixel) = __MKSMALLINT(WhitePixel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15324
    __INST(blackpixel) = __MKSMALLINT(BlackPixel);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15325
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15326
    __INST(monitorType) = @symbol(unknown);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15327
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15328
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15329
    __INST(hasColors) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15330
    __INST(hasGreyscales) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15331
    __INST(visualType) = @symbol(TrueColor);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15332
    __INST(redShift) = __MKSMALLINT(0);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15333
    __INST(greenShift) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15334
    __INST(blueShift) = __MKSMALLINT(16);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15335
    switch (__realDepth) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15336
	case 15:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15337
	case 16:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15338
	    __INST(bitsPerRGB) = __MKSMALLINT(5);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15339
	    break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15340
	default:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15341
	    __INST(bitsPerRGB) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15342
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15343
    __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15344
    __INST(redMask) = __MKSMALLINT(0xFF);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15345
    __INST(greenMask) = __MKSMALLINT(0xFF00);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15346
    __INST(blueMask) = __MKSMALLINT(0xFF0000);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15347
#else
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15348
    if (! (capabilities & RC_PALETTE)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15349
	DPRINTF(("no palette\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15350
	if (__depth == 1) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15351
	    __INST(hasColors) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15352
	    __INST(hasGreyscales) = false;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15353
	    __INST(visualType) = @symbol(GrayScale);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15354
	    __INST(monitorType) = @symbol(monochrome);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15355
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15356
	    __INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15357
	    __INST(hasGreyscales) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15358
	    if ((__depth == 16) || (__depth == 15)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15359
	      __INST(visualType) = @symbol(TrueColor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15360
	      __INST(blueShift) = __MKSMALLINT(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15361
	      __INST(greenShift) = __MKSMALLINT(5);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15362
	      __INST(redShift) = __MKSMALLINT(11);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15363
	      __INST(bitsPerRGB) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15364
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15365
	      __INST(blueMask) = __MKSMALLINT(0x1f);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15366
	      __INST(greenMask) = __MKSMALLINT(0x7e0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15367
	      __INST(redMask) = __MKSMALLINT(0xf800);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15368
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15369
	      __INST(visualType) = @symbol(TrueColor);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15370
	      __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15371
	      __INST(greenShift) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15372
	      __INST(blueShift) = __MKSMALLINT(16);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15373
	      __INST(bitsPerRGB) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15374
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15375
	      __INST(redMask) = __MKSMALLINT(0xFF);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15376
	      __INST(greenMask) = __MKSMALLINT(0xFF00);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15377
	      __INST(blueMask) = __MKSMALLINT(0xFF0000);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15378
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15379
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15380
    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15381
	val = GetDeviceCaps(__rootDC, SIZEPALETTE); /* First two entries are black and white. */
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15382
	// console_printf("SizeofPalette %d\n",val);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15383
	__INST(ncells) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15384
	__INST(blackpixel) = __MKSMALLINT(0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15385
	__INST(whitepixel) = __MKSMALLINT(1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15386
	__INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15387
	__INST(hasGreyscales) = true;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15388
	// __INST(usingSystemPalette) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15389
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15390
	__INST(redShift) = __MKSMALLINT(0);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15391
	__INST(greenShift) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15392
	__INST(blueShift) = __MKSMALLINT(4);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15393
	__INST(bitsPerRGB) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15394
	__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15395
	__INST(redMask) = __MKSMALLINT(0x3);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15396
	__INST(greenMask) = __MKSMALLINT(0xc);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15397
	__INST(blueMask) = __MKSMALLINT(0x30);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15398
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15399
#endif /* ! ALWAYSTRUECOLOR */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15400
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15401
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15402
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15403
initializeVariableSettingsProperties
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15404
    "fetch properties which can be changed via the user settings.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15405
     Invoked initially and as a result of the settingsChange event."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15406
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15407
%{
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15408
    UINT multiClickTime;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15409
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15410
    multiClickTime = GetDoubleClickTime();
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15411
    DPRINTF(("multiClickTime = %d\n", multiClickTime));
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15412
    __INST(multiClickTimeDelta) = __MKSMALLINT(multiClickTime);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15413
%}
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
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15416
primInitializeFor:aDisplayName
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15417
    "initialize the receiver for a connection to a display;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15418
     the argument, aDisplayName may be nil (for the default display)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15419
     or the name of the display server as hostname:number
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15420
     (not yet under WIN32)"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15421
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15422
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15423
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15424
    RETURN ( __MKSMALLINT(1) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15425
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15426
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15427
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15428
reinitialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15429
    rootWin := rootDC := nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15430
    super reinitialize.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15431
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15432
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15433
!WinWorkstation methodsFor:'keyboard mapping'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15434
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15435
altModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15436
    "return the mask (in motionEvents) for the alt-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15437
     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
 15438
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15439
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15440
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15441
    RETURN (__MKSMALLINT(AltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15442
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15443
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15444
    "Created: 23.3.1996 / 12:43:22 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15445
    "Modified: 23.3.1996 / 12:44:56 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15446
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15447
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15448
leftAltMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15449
    "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
 15450
     See comment in altModifierMask: / metaModifierMask: for what
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15451
     this could be used."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15452
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15453
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15454
    RETURN (__MKSMALLINT(LeftAltMask));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15455
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15456
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15457
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15458
metaModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15459
    "return the mask (in motionEvents) for the meta-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15460
     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
 15461
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15462
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15463
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15464
    RETURN (__MKSMALLINT(MetaMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15465
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15466
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15467
    "Created: 23.3.1996 / 12:43:39 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15468
    "Modified: 23.3.1996 / 12:45:09 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15469
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15470
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15471
modifierMapping
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15472
    "Get the Modifier Mapping.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15473
     We return an array of arrays of keycodes"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15474
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15475
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15476
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15477
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15478
rightAltMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15479
    "return the mask bit for the right Alt modifier key.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15480
     See comment in altModifierMask: / metaModifierMask: for what
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15481
     this could be used."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15482
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15483
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15484
    RETURN (__MKSMALLINT(RightAltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15485
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15486
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15487
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15488
stringFromKeycode:code
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15489
    "Get a KeySymbol (a smalltalk symbol) from the keycode."
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
    ^ ''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15492
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15493
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15494
	Display stringFromKeycode:28
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15495
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15496
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15497
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15498
!WinWorkstation methodsFor:'misc'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15499
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15500
beep
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15501
    "output an audible beep"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15502
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15503
    self beep:#iconExclamation volume:100.
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15504
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15505
    "
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15506
      Display beep
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15507
    "
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15508
!
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15509
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15510
beep:aSymbolOrInteger volume:volumeInPercent
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15511
    "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
 15512
     Volume is ignored here (kept for compatibility with XWorkstation"
5246
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
    UserPreferences current beepEnabled ifFalse:[^ self].
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
%{
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15517
    unsigned int type;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15518
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15519
    if (__isSmallInteger(aSymbolOrInteger)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15520
	type = __smallIntegerVal(aSymbolOrInteger);
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15521
    } else if (aSymbolOrInteger == @symbol(iconAsterisk)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15522
	type = MB_ICONASTERISK;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15523
    } else if (aSymbolOrInteger == @symbol(iconExclamation)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15524
	type = MB_ICONEXCLAMATION;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15525
    } else if (aSymbolOrInteger == @symbol(iconHand)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15526
	type = MB_ICONHAND;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15527
    } else if (aSymbolOrInteger == @symbol(iconQuestion)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15528
	type = MB_ICONQUESTION;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15529
    } else if (aSymbolOrInteger == @symbol(ok)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15530
	type = MB_OK;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15531
    } else {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15532
	type = 0xffffffff;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15533
    }
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15534
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15535
#ifdef BEEP_IN_WINTHREAD
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15536
    PostThreadMessage(_dispatchThreadId, WM_THREAD_BEEP, 0, 0);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15537
#else
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15538
    MessageBeep(type);
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15539
#endif
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15540
%}
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
    "
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15543
      Display beep:#iconExclamation volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15544
      Display beep:#iconAsterisk volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15545
      Display beep:#iconQuestion volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15546
      Display beep:#iconHand volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15547
      Display beep:#ok volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15548
      Display beep:nil volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15549
      Display beep:0 volume:100
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15550
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15551
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15552
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15553
canEndSession:aBoolean
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15554
    "if set to false, Windows is not allowed to finish this session.
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15555
     The default is true."
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15556
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15557
    CanEndSession := aBoolean.
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15558
!
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15559
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15560
flush
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15561
    "send all buffered drawing to the display.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15562
     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
 15563
     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
 15564
     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
 15565
     (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
 15566
     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
 15567
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15568
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15569
     GdiFlush();
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15570
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15571
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15572
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15573
monitorHandleForPoint:aPoint
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15574
    "given a point, return a handle to the monitor"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15575
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15576
    |pX pY|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15577
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15578
    pX := aPoint x.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15579
    pY := aPoint y.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15580
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15581
    if (__bothSmallInteger(pX, pY)) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15582
	POINT p;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15583
	HMONITOR hMonitor;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15584
	p.x = __intVal(pX);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15585
	p.y = __intVal(pY);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15586
#if 0
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15587
	/* the following is only needed when we want
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15588
	 * to support very old NT/W95/W98 systems; we don't !
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15589
	 */
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15590
	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
 15591
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15592
	if (P_MonitorFromPoint == 0) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15593
	    HINSTANCE hUser = LoadLibrary("user32.dll");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15594
	    // 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
 15595
	    if (hUser) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15596
		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
 15597
				    GetProcAddress(hUser, "MonitorFromPoint");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15598
	    }
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
	// 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
 15601
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15602
	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
 15603
#else
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15604
	hMonitor = MonitorFromPoint(p, MONITOR_DEFAULTTONULL);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15605
#endif
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15606
	if (hMonitor == 0) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15607
	    RETURN(nil);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15608
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15609
	RETURN ( __MKEXTERNALADDRESS(hMonitor) );
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15610
    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15611
%}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15612
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15613
     Screen current monitorHandleForPoint:(0@0)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15614
     Screen current monitorHandleForPoint:(1500@0)
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15615
     Screen current monitorHandleForPoint:(3000@0)
5549
fd4fc69df52d fixed: #monitorHandleForPoint:
Claus Gittinger <cg@exept.de>
parents: 5546
diff changeset
 15616
     Screen current monitorHandleForPoint:(Display pointFromUser)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15617
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15618
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15619
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15620
monitorHandleForView:aWindowId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15621
    "given a window ID, return a handle to the monitor"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15622
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15623
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15624
    if (__isExternalAddress(aWindowId)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15625
	HWND hWnd = _HWNDVal(aWindowId);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15626
	HMONITOR hMonitor;
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15627
#if 0
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15628
	/* the following is only needed when we want
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15629
	 * to support very old NT/W95/W98 systems; we don't !
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15630
	 */
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15631
	static HMONITOR (__stdcall *P_MonitorFromWindow)(HWND, int);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15632
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15633
	if (P_MonitorFromWindow == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15634
	    HINSTANCE hUser = LoadLibrary("user32.dll");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15635
	    // console_printf("hUser: %x\n", hUser);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15636
	    if (hUser) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15637
		P_MonitorFromWindow = (HMONITOR (__stdcall *)(HWND, int ))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15638
				    GetProcAddress(hUser, "MonitorFromWindow");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15639
	    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15640
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15641
	// console_printf("P_MonitorFromWindow: %x\n", P_MonitorFromWindow);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15642
	hMonitor = (*P_MonitorFromWindow)(hWnd, MONITOR_DEFAULTTONULL);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15643
#else
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15644
	hMonitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONULL);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15645
#endif
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15646
	if (hMonitor == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15647
	    RETURN(nil);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15648
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15649
	RETURN ( __MKEXTERNALADDRESS(hMonitor) );
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15650
    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15651
%}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15652
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15653
     Screen current monitorHandleForView:(Transcript topView id)
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15654
     Screen current monitorHandleForPoint:(0@0)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15655
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15656
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15657
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15658
monitorHandles
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15659
    "retrieve a list of monitor handles"
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15660
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15661
    |handleArray|
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15662
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15663
    handleArray := Array new:(self numberOfMonitors).
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15664
%{
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15665
    struct EnumDisplayMonitorsProcData data;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15666
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15667
    data.hArray = handleArray;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15668
    data.index = 0;
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 15669
    EnumDisplayMonitors(NULL, NULL, EnumDisplayMonitorsProc, (INT)&data);
5835
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
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
 15672
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
 15673
    "
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
 15674
     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
 15675
    "
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
 15676
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
 15677
    "Modified (comment): / 28-01-2012 / 10:26:55 / cg"
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15680
setInputFocusTo:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15681
    self setInputFocusTo:aWindowId revertTo:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15682
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15683
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15684
setInputFocusTo:aWindowId revertTo:revertSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15685
    "set the focus to the view as defined by aWindowId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15686
     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
 15687
     input until a new focus is set.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15688
     RevertSymbol specifies what should happen if the view becomes invisible;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15689
     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
 15690
     given to the parent view, the root view or no view."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15691
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15692
%{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15693
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15694
	HWND hWnd = _HWNDVal(aWindowId);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 15695
	int r = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15696
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15697
	if (revertSymbol == @symbol(parent)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15698
	    r = 1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15699
	} else if (revertSymbol == @symbol(root)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15700
	    r = 2;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15701
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15702
	if (hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15703
	    if (GetFocus() != hWnd) {
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 15704
		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
 15705
#ifdef SET_FOCUS_IN_WINTHREAD
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15706
		PostMessage(hWnd, WM_THREAD_SETFOCUS, (INT)hWnd, GetCurrentThreadId());
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15707
#else
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15708
		if (SetFocus(hWnd) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15709
		    PRINTF(("SetFocus to %x failed.\n",hWnd));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15710
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15711
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15712
	    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15713
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 15714
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15715
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15716
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15717
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15718
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15719
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15720
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15721
!WinWorkstation methodsFor:'native dialogs'!
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15722
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15723
nativeConfirm:aString title:titleString flags:flags initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15724
     ^ self
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15725
	    nativeMessageBoxFor:nil
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15726
	    text:aString asString string
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15727
	    title:titleString
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15728
	    flags:flags
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15729
	    blocking:false
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15730
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15731
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15732
      Screen current
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15733
	nativeConfirm:'please confirm'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15734
	title:'Confirm'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15735
	flags:#( APPLMODAL ICONQUESTION OKCANCEL)
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15736
	initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15737
     "
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
      Screen current
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15740
	nativeConfirm:'Yes or No'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15741
	title:'Confirm'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15742
	flags:#( APPLMODAL ICONQUESTION YESNO)
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15743
	initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15744
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15745
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15746
    "Modified: / 02-03-2007 / 15:37:57 / cg"
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15747
    "Modified: / 24-08-2010 / 16:17:29 / sr"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15748
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15749
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15750
nativeConfirmOKCancel:aString title:titleString initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15751
     ^ (self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15752
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15753
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15754
	    flags:#( APPLMODAL ICONQUESTION OKCANCEL)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15755
	    initialAnswer:trueOrFalse) == #IDOK
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
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15759
	nativeConfirmOKCancel:'please confirm' title:'Confirm' initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15760
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15761
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15762
    "Modified: / 02-03-2007 / 15:37:32 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15763
!
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
nativeConfirmYesNo:aString title:titleString initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15766
     ^ (self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15767
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15768
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15769
	    flags:#( APPLMODAL ICONQUESTION YESNO)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15770
	    initialAnswer:trueOrFalse) == #IDYES
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
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15774
	nativeConfirmYesNo:'please confirm' title:'Confirm' initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15775
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15776
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15777
    "Modified: / 02-03-2007 / 15:12:49 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15778
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15779
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15780
nativeFileDialogFor:ownerId save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15781
	     initialAnswer:initialOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15782
	     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
 15783
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15784
    "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
 15785
     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
 15786
     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
 15787
     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
 15788
     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
 15789
     filterArrayOrNil: if non nil, must be an array of 2-element arrays,
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15790
		       each element specifying filter commnet and filter
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15791
		       i.e. #( 'bitmap files (*.bmp)' '*.bmp' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15792
		       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
 15793
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15794
     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
 15795
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15796
    |flags|
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15797
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15798
    isSaveDialog ifTrue:[
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15799
	flags := #(
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15800
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15801
			#HIDEREADONLY
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15802
			#EXPLORER
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15803
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15804
			#OVERWRITEPROMPT
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15805
			#NOCHANGEDIR
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15806
		  )
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15807
    ] ifFalse:[
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15808
	flags := #(
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15809
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15810
			#HIDEREADONLY
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15811
			#EXPLORER
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15812
			#ENABLESIZING
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
    ].
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15816
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15817
    ^ self
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15818
	nativeFileDialogFor:ownerId
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15819
	save:isSaveDialog
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15820
	title:titleOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15821
	inDirectory:dirPathOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15822
	initialAnswer:initialOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15823
	flags:flags
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15824
	filter:filterArrayOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15825
	extension:extensionOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15826
	blocking:false
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15827
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15828
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15829
     Display
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15830
	nativeFileDialogFor:nil save:false
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15831
	title:'Test OpenFile Dialog'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15832
	inDirectory:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15833
	initialAnswer:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15834
	filter:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15835
	extension:nil
3562
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:true
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15839
	title:'Test SaveFile 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:'newFile.bmp'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15850
	filter:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15851
	extension:'bmp'
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:false
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15855
	title:'Test OpenFile Dialog'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15856
	inDirectory:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15857
	initialAnswer:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15858
	filter:#(
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15859
		    #( 'all files'       '*.*' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15860
		    #( 'smalltalk files' '*.st' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15861
		    #( 'change files'    '*.chg' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15862
		    #( 'image files'     '*.img' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15863
		)
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15864
	extension:nil
5641
b03c7d938fca changed: #nativeFileDialogFor:save:title:inDirectory:initialAnswer:filter:extension:
Claus Gittinger <cg@exept.de>
parents: 5640
diff changeset
 15865
    "
b03c7d938fca changed: #nativeFileDialogFor:save:title:inDirectory:initialAnswer:filter:extension:
Claus Gittinger <cg@exept.de>
parents: 5640
diff changeset
 15866
b03c7d938fca changed: #nativeFileDialogFor:save:title:inDirectory:initialAnswer:filter:extension:
Claus Gittinger <cg@exept.de>
parents: 5640
diff changeset
 15867
    "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
 15868
!
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15869
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15870
nativeFileDialogFor:ownerId save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15871
	     initialAnswer:initialOrNil flags:flagArray
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15872
	     filter:filterArrayOrNil extension:extensionOrNil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15873
	     blocking:blocking
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15874
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15875
    "start a native open-file dialog.
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15876
     If not cancelled, the selected fileName is returned; nil otherwise.
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15877
     Of course, this one looks like the
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15878
     Windows file dialog - no matter which viewStyle settings are active.
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15879
     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
 15880
     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
 15881
		       each element specifying filter commnet and filter
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15882
		       i.e. #( 'bitmap files (*.bmp)' '*.bmp' )
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15883
		       i.e. #( 'smalltalk files' '*.st' )
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15884
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15885
     EXPERIMENTAL & non-portable: use with caution"
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15886
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15887
    |rslt errorCode fileName|
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15888
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15889
%{  /* STACK: 32000*/
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15890
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15891
#ifndef NO_NATIVE_DIALOGS
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15892
    OPENFILENAME ofn;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15893
    HWND hWndOwner = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15894
    char fileNameBuffer[256] = "\0";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15895
    char filterBuffer[1024*4] = "\0";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15896
    BOOL __rslt;
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15897
    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
 15898
    extern void __setAtExitLongJmp(jmp_buf);
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15899
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15900
    if (__isExternalAddress(ownerId)) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15901
	hWndOwner = _HWNDVal(ownerId);
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15902
    }
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15903
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15904
# ifdef OPENFILENAME_SIZE_VERSION_400
3526
e9c3f08c2305 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
 15905
    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
 15906
# else
3544
6c59714157cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
 15907
    ofn.lStructSize = sizeof(ofn);
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15908
# endif
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15909
    ofn.hwndOwner = hWndOwner;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15910
    ofn.hInstance = NULL;
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15911
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15912
    if ((filterArrayOrNil != nil) && __isArrayLike(filterArrayOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15913
	char *dst = filterBuffer;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 15914
	unsigned int idx;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15915
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15916
	for (idx=0; idx<__arraySize(filterArrayOrNil); idx++) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15917
	    OBJ el = __ArrayInstPtr(filterArrayOrNil)->a_element[idx];
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 15918
	    // console_printf("idx = %d\n", idx);
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15919
	    if (__isArrayLike(el) && (__arraySize(el) == 2)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15920
		OBJ descr, filter;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15921
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15922
		descr = __ArrayInstPtr(el)->a_element[0];
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15923
		filter = __ArrayInstPtr(el)->a_element[1];
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15924
		if (__isStringLike(descr) && __isStringLike(filter)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15925
		    char *src = __stringVal(descr);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15926
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 15927
		    // 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
 15928
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15929
		    // append (incl 0-byte)
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15930
		    while (*src) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15931
			*dst++ = *src++;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15932
		    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15933
		    *dst++ = '\0';
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15934
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15935
		    src = __stringVal(filter);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15936
		    // append (incl 0-byte)
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15937
		    while (*src) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15938
			*dst++ = *src++;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15939
		    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15940
		    *dst++ = '\0';
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15941
		}
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
	}
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15944
	*dst++ = '\0';
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15945
	*dst = '\0';
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15946
	ofn.lpstrFilter = filterBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15947
	ofn.nFilterIndex = 1;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15948
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15949
	ofn.lpstrFilter = NULL;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15950
	ofn.nFilterIndex = 0;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15951
    }
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15952
    ofn.lpstrCustomFilter = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15953
    ofn.nMaxCustFilter = 0;
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15954
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15955
    if (__isStringLike(initialOrNil)) {
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15956
	strcpy(fileNameBuffer, __stringVal(initialOrNil));
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15957
    }
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15958
    ofn.lpstrFile = fileNameBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15959
    ofn.nMaxFile = sizeof(fileNameBuffer);
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15960
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15961
    ofn.lpstrFileTitle = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15962
    ofn.nMaxFileTitle = 0;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15963
    if (__isStringLike(dirPathOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15964
	ofn.lpstrInitialDir = __stringVal(dirPathOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15965
    } else {
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15966
	ofn.lpstrInitialDir = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15967
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15968
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15969
    if (__isStringLike(titleOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15970
	ofn.lpstrTitle = __stringVal(titleOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15971
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15972
	ofn.lpstrTitle = "";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15973
    }
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15974
    ofn.nFileOffset = 0;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15975
    ofn.nFileExtension = 0;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15976
    if (__isStringLike(extensionOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15977
	ofn.lpstrDefExt = __stringVal(extensionOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15978
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15979
	ofn.lpstrDefExt = NULL;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15980
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15981
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 15982
    ofn.lCustData = (INT)NULL;
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15983
    ofn.lpfnHook = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15984
    ofn.lpTemplateName = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15985
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15986
    ofn.Flags = 0;
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15987
    if (__isNonNilObject(flagArray) && __isArrayLike(flagArray)) {
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 15988
	unsigned int i;
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15989
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15990
	for (i=0; i<__arraySize(flagArray); i++) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15991
	    OBJ flag = __ArrayInstPtr(flagArray)->a_element[i];
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15992
	    int flagVal = 0;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15993
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15994
	    if (__isSmallInteger(flag)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15995
		flagVal = __intVal(flag);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15996
	    } else if (flag == @symbol(READONLY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15997
		flagVal = OFN_READONLY;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15998
	    } else if (flag == @symbol(OVERWRITEPROMPT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15999
		flagVal = OFN_OVERWRITEPROMPT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16000
	    } else if (flag == @symbol(HIDEREADONLY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16001
		flagVal = OFN_HIDEREADONLY;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16002
	    } else if (flag == @symbol(NOCHANGEDIR)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16003
		flagVal = OFN_NOCHANGEDIR;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16004
	    } else if (flag == @symbol(SHOWHELP)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16005
		flagVal = OFN_SHOWHELP;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16006
	    } else if (flag == @symbol(ENABLEHOOK)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16007
		flagVal = OFN_ENABLEHOOK;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16008
	    } else if (flag == @symbol(ENABLETEMPLATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16009
		flagVal = OFN_ENABLETEMPLATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16010
	    } else if (flag == @symbol(ENABLETEMPLATEHANDLE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16011
		flagVal = OFN_ENABLETEMPLATEHANDLE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16012
	    } else if (flag == @symbol(NOVALIDATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16013
		flagVal = OFN_NOVALIDATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16014
	    } else if (flag == @symbol(ALLOWMULTISELECT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16015
		flagVal = OFN_ALLOWMULTISELECT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16016
	    } else if (flag == @symbol(EXTENSIONDIFFERENT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16017
		flagVal = OFN_EXTENSIONDIFFERENT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16018
	    } else if (flag == @symbol(PATHMUSTEXIST)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16019
		flagVal = OFN_PATHMUSTEXIST;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16020
	    } else if (flag == @symbol(FILEMUSTEXIST)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16021
		flagVal = OFN_FILEMUSTEXIST;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16022
	    } else if (flag == @symbol(CREATEPROMPT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16023
		flagVal = OFN_CREATEPROMPT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16024
	    } else if (flag == @symbol(SHAREAWARE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16025
		flagVal = OFN_SHAREAWARE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16026
	    } else if (flag == @symbol(NOREADONLYRETURN)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16027
		flagVal = OFN_NOREADONLYRETURN;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16028
	    } else if (flag == @symbol(NOTESTFILECREATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16029
		flagVal = OFN_NOTESTFILECREATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16030
	    } else if (flag == @symbol(NONETWORKBUTTON)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16031
		flagVal = OFN_NONETWORKBUTTON;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16032
	    } else if (flag == @symbol(NOLONGNAMES)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16033
		flagVal = OFN_NOLONGNAMES;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16034
# ifdef OFN_EXPLORER
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16035
	    } else if (flag == @symbol(EXPLORER)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16036
		flagVal = OFN_EXPLORER;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16037
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16038
# ifdef OFN_NODEREFERENCELINKS
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16039
	    } else if (flag == @symbol(NODEREFERENCELINKS)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16040
		flagVal = OFN_NODEREFERENCELINKS;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16041
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16042
# ifdef OFN_LONGNAMES
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16043
	    } else if (flag == @symbol(LONGNAMES)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16044
		flagVal = OFN_LONGNAMES;
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_ENABLEINCLUDENOTIFY
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16047
	    } else if (flag == @symbol(ENABLEINCLUDENOTIFY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16048
		flagVal = OFN_ENABLEINCLUDENOTIFY;
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_ENABLESIZING
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16051
	    } else if (flag == @symbol(ENABLESIZING)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16052
		flagVal = OFN_ENABLESIZING;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16053
# endif
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16054
	    }
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16055
	    ofn.Flags |= flagVal;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16056
	}
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16057
    }
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 16058
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16059
    if (isSaveDialog == true) {
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16060
	if (blocking == true) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16061
	    __rslt = GetSaveFileName(&ofn);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16062
	} else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16063
	    do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16064
		__threadErrno = 0;
7509
d18f375ac80d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7472
diff changeset
 16065
		__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
 16066
	    } while ((__rslt < 0) && (__threadErrno == EINTR));
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16067
	}
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16068
    } else {
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16069
	if (blocking == true) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16070
	    __rslt = GetOpenFileName(&ofn);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16071
	} else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16072
	    do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16073
		__threadErrno = 0;
7509
d18f375ac80d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7472
diff changeset
 16074
		__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
 16075
	    } while ((__rslt < 0) && (__threadErrno == EINTR));
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16076
	}
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16077
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16078
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16079
    if ( @global(WinWorkstation:VerboseNativeDialogs) == true) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16080
	console_fprintf(stderr, "WinWorkstation [info]: after GetOpenFileName\n");
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16081
    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16082
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16083
    if (setjmp(exitJmpBuf)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16084
	__setAtExitLongJmp(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16085
	if ( @global(WinWorkstation:VerboseNativeDialogs) == true) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16086
	    console_fprintf(stderr, "WinWorkstation [warning]: exit longjmp\n");
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16087
	}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16088
	rslt = false;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16089
	errorCode = __MKSMALLINT(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16090
	goto getOutOfHere;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16091
    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16092
    __setAtExitLongJmp(exitJmpBuf);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16093
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16094
    if (__rslt == TRUE) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16095
	rslt = true;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16096
	fileName = __MKSTRING(fileNameBuffer);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16097
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16098
	rslt = false;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16099
	errorCode = __MKSMALLINT(CommDlgExtendedError());
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16100
    }
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16101
    __setAtExitLongJmp(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16102
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16103
#else
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16104
    errorCode = __MKSMALLINT(-1);
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16105
#endif /* NO_NATIVE_DIALOGS */
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16106
getOutOfHere: ;
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 16107
%}.
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16108
    (errorCode notNil) ifTrue:[
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 16109
	errorCode ~~ 0 ifTrue:[
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 16110
	    self primitiveFailed.
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 16111
	].
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 16112
	^ nil
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 16113
    ].
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 16114
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16115
    ^ fileName
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16116
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16117
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16118
     Display
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16119
	nativeFileDialogFor:nil save:false
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16120
	title:'Test OpenFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16121
	inDirectory:nil
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 16122
	initialAnswer:nil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16123
	flags:#( ENABLESIZING HIDEREADONLY EXPLORER ENABLESIZING )
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16124
	filter:#(
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16125
		    #( 'all files'       '*.*' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16126
		    #( 'smalltalk files' '*.st' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16127
		    #( 'change files'    '*.chg' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16128
		    #( 'image files'     '*.img' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16129
		)
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16130
	extension:nil
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16131
	blocking:false
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16132
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16133
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16134
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16135
     Display
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16136
	nativeFileDialogFor:nil save:false
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16137
	title:'Test OpenFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16138
	inDirectory:nil
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16139
	initialAnswer:nil
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16140
	flags:#( ENABLESIZING HIDEREADONLY EXPLORER ENABLESIZING )
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16141
	filter:#(
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16142
		    #( 'all files'       '*.*' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16143
		    #( 'smalltalk files' '*.st' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16144
		    #( 'change files'    '*.chg' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16145
		    #( 'image files'     '*.img' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16146
		)
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16147
	extension:nil
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16148
	blocking:true
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16149
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16150
!
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16151
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16152
nativeGetDefaultPrinterDialog
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16153
    "start a native printer dialog.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16154
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16155
     EXPERIMENTAL & non-portable: use with caution"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16156
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16157
    |errorCode newDCHandle|
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16158
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16159
%{  /* STACK: 32000*/
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16160
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16161
#ifdef NO_NATIVE_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16162
# define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16163
#endif
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
#define NO_NATIVE_PRINT_DIALOGS
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
#ifndef NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16168
    PRINTDLG pdsetup;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16169
    OBJ newGCHandle;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16170
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16171
    memset(&pdsetup, 0, sizeof(pdsetup));
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16172
    pdsetup.lStructSize = sizeof(pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16173
    pdsetup.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16174
    if (! PrintDlg(&pdsetup)) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16175
	RETURN (nil);
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16176
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16177
    if ( pdsetup.hDC ) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16178
	newDCHandle = __MKOBJ( pdsetup.hDC );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16179
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16180
#else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16181
    errorCode = __MKSMALLINT(-1);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16182
#endif /* NO_NATIVE_PRINT_DIALOGS */
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16183
%}.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16184
    (errorCode notNil) ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16185
	self primitiveFailed.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16186
	^ nil
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
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16189
    ^ newDCHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16190
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
     Display nativeGetDefaultPrinterDialog
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16193
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16194
!
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
nativeGetPrinterDialogDefault:defaultBoolean
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16197
    "start a native printer dialog.
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
     EXPERIMENTAL & non-portable: use with caution"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16200
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16201
    |errorCode newDCHandle|
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
%{  /* STACK: 32000*/
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16204
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16205
#ifdef NO_NATIVE_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16206
# define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16207
#endif
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
#define xxNO_NATIVE_PRINT_DIALOGS
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
#ifndef NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16212
    PRINTDLG pdsetup;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16213
    OBJ newGCHandle;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16214
    int answer;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16215
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16216
    memset(&pdsetup, 0, sizeof(pdsetup));
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16217
    pdsetup.lStructSize = sizeof(pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16218
    pdsetup.Flags = PD_RETURNDC;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16219
    if (defaultBoolean == true) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16220
	pdsetup.Flags |= PD_RETURNDEFAULT;
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16221
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16222
# ifdef BLOCKING
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16223
    answer = PrintDlg(&pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16224
# else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16225
    answer = __STX_API_CALL1( "PrintDlg",
7509
d18f375ac80d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7472
diff changeset
 16226
					(voidFUNC)PrintDlg,
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16227
					(void *)&pdsetup );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16228
# endif
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16229
    if (! answer) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16230
	RETURN (nil);
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16231
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16232
    if ( pdsetup.hDC ) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16233
	newDCHandle = __MKOBJ( pdsetup.hDC );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16234
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16235
#else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16236
    errorCode = __MKSMALLINT(-1);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16237
#endif /* NO_NATIVE_PRINT_DIALOGS */
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16238
%}.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16239
    (errorCode notNil) ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16240
	self primitiveFailed.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16241
	^ nil
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
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16244
    ^ newDCHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16245
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
     Display nativeGetPrinterDialogDefault:true
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16248
     Display nativeGetPrinterDialogDefault:false
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16249
    "
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
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16252
nativeInformationOK:aString title:titleString
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16253
     ^ self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16254
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16255
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16256
	    flags:#( APPLMODAL ICONINFORMATION OK)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16257
	    initialAnswer:nil
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16258
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16259
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16260
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16261
	nativeInformationOK:'Some Info' title:'Info'
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16262
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 16263
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 16264
    "Modified: / 02-03-2007 / 15:37:40 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16265
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16266
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16267
nativeMessageBoxFor:ownerId text:textOrNil title:titleOrNil flags:flagArray blocking:blocking
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16268
    "start a native message box dialog.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16269
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16270
     EXPERIMENTAL & non-portable: use with caution"
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16271
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16272
    |errorCode answer|
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16273
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16274
%{  /* STACK: 32000*/
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16275
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16276
#ifndef NO_NATIVE_DIALOGS
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16277
    HWND hWndOwner = NULL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16278
    int boxFlags = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16279
    char *__title;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16280
    char *__text;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 16281
    INT __answer;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16282
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16283
    if (__isExternalAddress(ownerId)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16284
	hWndOwner = _HWNDVal(ownerId);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16285
    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 16286
    if (__isStringLike(titleOrNil)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16287
	__title = __stringVal(titleOrNil);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16288
    } else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16289
	__title = "";
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16290
    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 16291
    if (__isStringLike(textOrNil)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16292
	__text = __stringVal(textOrNil);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16293
    } else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16294
	__text = "";
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16295
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16296
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 16297
    if (__isNonNilObject(flagArray) && __isArrayLike(flagArray)) {
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 16298
	unsigned int i;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16299
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16300
	for (i=0; i<__arraySize(flagArray); i++) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16301
	    OBJ flag = __ArrayInstPtr(flagArray)->a_element[i];
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16302
	    int flagVal = 0;
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
	    if (__isSmallInteger(flag)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16305
		flagVal = __intVal(flag);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16306
	    } else if (flag == @symbol(ABORTRETRYIGNORE)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16307
		flagVal = MB_ABORTRETRYIGNORE;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16308
	    } else if (flag == @symbol(APPLMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16309
		flagVal = MB_APPLMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16310
	    } else if (flag == @symbol(DEFAULT_DESKTOP_ONLY)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16311
		flagVal = MB_DEFAULT_DESKTOP_ONLY;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16312
	    } else if (flag == @symbol(DEFBUTTON1)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16313
		flagVal = MB_DEFBUTTON1;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16314
	    } else if (flag == @symbol(DEFBUTTON2)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16315
		flagVal = MB_DEFBUTTON2;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16316
	    } else if (flag == @symbol(DEFBUTTON3)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16317
		flagVal = MB_DEFBUTTON3;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16318
	    } else if (flag == @symbol(ICONASTERISK)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16319
		flagVal = MB_ICONASTERISK;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16320
	    } else if (flag == @symbol(ICONHAND)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16321
		flagVal = MB_ICONHAND;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16322
	    } else if (flag == @symbol(ICONINFORMATION)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16323
		flagVal = MB_ICONINFORMATION;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16324
	    } else if (flag == @symbol(ICONQUESTION)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16325
		flagVal = MB_ICONQUESTION;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16326
	    } else if (flag == @symbol(ICONSTOP)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16327
		flagVal = MB_ICONSTOP;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16328
	    } else if (flag == @symbol(OK)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16329
		flagVal = MB_OK;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16330
	    } else if (flag == @symbol(OKCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16331
		flagVal = MB_OKCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16332
	    } else if (flag == @symbol(RETRYCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16333
		flagVal = MB_RETRYCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16334
	    } else if (flag == @symbol(SETFOREGROUND)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16335
		flagVal = MB_SETFOREGROUND;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16336
	    } else if (flag == @symbol(SYSTEMMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16337
		flagVal = MB_SYSTEMMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16338
	    } else if (flag == @symbol(TASKMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16339
		flagVal = MB_TASKMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16340
	    } else if (flag == @symbol(YESNO)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16341
		flagVal = MB_YESNO;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16342
	    } else if (flag == @symbol(YESNOCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16343
		flagVal = MB_YESNOCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16344
	    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16345
	    boxFlags |= flagVal;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16346
	}
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16347
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16348
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16349
    if (blocking == true) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16350
	__answer = MessageBox(hWndOwner,
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 16351
			      __text,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 16352
			      __title,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 16353
			      boxFlags);
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16354
    } else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16355
	do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16356
	    __threadErrno = 0;
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 16357
	    __answer = (INT) __STX_API_CALL4(
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 16358
					"MessageBox",
7509
d18f375ac80d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7472
diff changeset
 16359
					(voidFUNC)MessageBox,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16360
					(void *)hWndOwner,
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16361
					(void *)__text,
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16362
					(void *)__title,
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 16363
					(void *)((INT)boxFlags));
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16364
	} while ((__answer < 0) && (__threadErrno == EINTR));
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16365
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16366
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16367
    switch (__answer) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16368
	case IDABORT:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16369
	    answer = @symbol(IDABORT);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16370
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16371
	case IDCANCEL:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16372
	    answer = @symbol(IDCANCEL);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16373
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16374
	case IDIGNORE:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16375
	    answer = @symbol(IDIGNORE);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16376
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16377
	case IDNO:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16378
	    answer = @symbol(IDNO);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16379
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16380
	case IDOK:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16381
	    answer = @symbol(IDOK);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16382
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16383
	case IDRETRY:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16384
	    answer = @symbol(IDRETRY);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16385
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16386
	case IDYES:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16387
	    answer = @symbol(IDYES);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16388
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16389
	default:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16390
	    answer = __MKSMALLINT(__answer);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16391
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16392
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16393
#else
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16394
    errorCode = __MKSMALLINT(-1);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16395
#endif /* NO_NATIVE_DIALOGS */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16396
%}.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16397
    (errorCode notNil) ifTrue:[
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16398
	self primitiveFailed.
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 16399
	^ nil
3570
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
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16402
    ^ answer
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16403
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16404
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16405
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16406
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16407
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16408
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16409
	flags:#( OK APPLMODAL ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16410
	blocking:true
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16411
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16412
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16413
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16414
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16415
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16416
	flags:#( OK APPLMODAL ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16417
	blocking:false
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16418
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16419
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16420
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16421
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16422
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16423
	flags:#( ABORTRETRYIGNORE ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16424
	blocking:false
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16425
    "
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16426
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16427
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16428
nativeWarnOK:aString title:titleString
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16429
     ^ self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16430
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16431
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16432
	    flags:#( APPLMODAL ICONSTOP OK)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16433
	    initialAnswer:nil
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
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16436
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16437
	nativeWarnOK:'some warning' title:'Warning'
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16438
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 16439
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 16440
    "Modified: / 02-03-2007 / 15:37:47 / cg"
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 16441
! !
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 16442
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16443
!WinWorkstation methodsFor:'native widget support'!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16444
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16445
nativeDialogs
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16446
    ^ NativeDialogs ? false
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16447
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16448
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16449
nativeDialogs:aBoolean
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16450
    "enable / disable use of native dialogs.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16451
     This is an experimental, unfinished, unsupported feature.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16452
     For now, this only affects some file-, warning-, information and confirmation dialogs."
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16453
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16454
    NativeDialogs := aBoolean
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16455
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16456
    "
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16457
     Screen current nativeDialogs:true
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16458
     Screen current nativeDialogs:false
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16459
    "
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16460
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16461
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16462
nativeFileDialogs
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16463
    ^ NativeFileDialogs ? false
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16464
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16465
    "Created: / 24-08-2010 / 16:41:13 / sr"
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16466
!
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16467
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16468
nativeFileDialogs:aBoolean
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16469
    "enable / disable use of native file dialogs.
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16470
     This is an experimental, unfinished, unsupported feature.
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16471
     For now, this only affects some file dialogs."
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16472
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16473
    NativeFileDialogs := aBoolean
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
     Screen current nativeFileDialogs:true
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16477
     Screen current nativeFileDialogs:false
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16478
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16479
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16480
    "Created: / 24-08-2010 / 16:41:36 / sr"
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16481
!
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16482
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16483
nativeWidgets
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16484
    ^ NativeWidgets ? false
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16485
!
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16486
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16487
nativeWidgets:aBoolean
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16488
    "enable / disable use of native widgets.
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16489
     This is an experimental, unfinished, unsupported feature.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16490
     For now, this only affects some widgets."
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16491
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16492
    NativeWidgets := aBoolean
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
     Screen current nativeWidgets:true
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16496
     Screen current nativeWidgets:false
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16497
    "
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16498
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16499
4263
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16500
supportsNativeDialogs
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16501
    ^ true
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16502
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16503
    "
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16504
     Screen current supportsNativeDialogs
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16505
    "
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16506
!
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16507
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16508
supportsNativeFileDialogs
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16509
    ^ true
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16510
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16511
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16512
     Screen current supportsNativeFileDialogs
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16513
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16514
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16515
    "Created: / 24-08-2010 / 16:28:42 / sr"
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16516
!
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16517
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16518
supportsNativeWidgets
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16519
    ^ true
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16520
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16521
    "
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16522
     Screen current supportsNativeWidgets
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16523
    "
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16524
! !
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16525
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16526
!WinWorkstation methodsFor:'pointer queries '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16527
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16528
anyButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16529
    "return an integer for masking out any button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16530
     buttonStates value."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16531
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16532
    "/ should use ``Display buttonXMotionMask bitOr:....''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16533
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16534
%{  /* NOCONTEXT */
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16535
    RETURN ( __MKSMALLINT(AnyButtonMask) );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16536
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16537
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16538
    "Modified: 23.3.1996 / 12:41:33 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16539
    "Created: 23.3.1996 / 12:46:35 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16540
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16541
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16542
buttonStates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16543
    "return an integer representing the state of the pointer buttons;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16544
     a one-bit in positions 0.. represent a pressed button.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16545
     See the button1Mask/button2Mask/button3Mask,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16546
     shiftMask/controlMask and modifierMask methods for the meaning of the bits."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16547
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16548
%{  /* NOCONTEXT */
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16549
    int modifiers = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16550
    int b1m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16551
    int b3m = Button3Mask;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16552
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16553
    if (GetSystemMetrics(SM_SWAPBUTTON)) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16554
	b3m = Button1Mask;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16555
	b1m = Button3Mask;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16556
    }
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16557
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16558
    if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16559
	modifiers |= b1m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16560
    if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16561
	modifiers |= Button2Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16562
    if (GetAsyncKeyState(VK_RBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16563
	modifiers |= b3m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16564
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16565
    RETURN (__MKSMALLINT(modifiers));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16566
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16567
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16568
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16569
     Display buttonStates
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16570
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16571
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16572
    "is the control-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16573
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16574
     Display buttonStates bitTest:(Display controlMask)
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16577
    "is the alt/meta-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16578
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16579
     Display buttonStates bitTest:(Display altModifierMask)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16580
     Display buttonStates bitTest:(Display metaModifierMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16581
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16582
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16583
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16584
leftButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16585
    "return an integer for masking out the left button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16586
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16587
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16588
    "/ should use ``Display button1MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16589
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16590
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16591
    RETURN ( __MKSMALLINT(Button1Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16592
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16593
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16594
    "Modified: 23.3.1996 / 12:41:33 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16595
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16596
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16597
middleButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16598
    "return an integer for masking out the middle button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16599
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16600
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16601
    "/ should use ``Display button2MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16602
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16603
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16604
    RETURN ( __MKSMALLINT(Button2Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16605
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16606
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16607
    "Modified: 23.3.1996 / 12:41:43 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16608
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16609
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16610
pointerPosition
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
 16611
    "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
 16612
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16613
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16614
    POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16615
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16616
    if (! GetCursorPos(&p)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16617
	p.x = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16618
	p.y = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16619
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16620
    RETURN (__MKPOINT_INT(p.x, p.y));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16621
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16622
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16623
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16624
rightButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16625
    "return an integer for masking out the right button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16626
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16627
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16628
    "/ should use ``Display button3MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16629
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16630
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16631
    RETURN ( __MKSMALLINT(Button3Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16632
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16633
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16634
    "Modified: 23.3.1996 / 12:41:52 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16635
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16636
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16637
rootPositionOfLastEvent
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16638
    "return the position in root-window coordinates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16639
     of the last button, key or pointer event"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16640
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16641
%{  /* NOCONTEXT */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16642
    RETURN (__MKPOINT_INT(evRootX, evRootY));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16643
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16644
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16645
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16646
setPointerPosition:newPosition
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16647
    "change the pointer position in root-window coordinates."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16648
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16649
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16650
    if (__isPoint(newPosition)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16651
	OBJ xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16652
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16653
	xpos = __point_X(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16654
	ypos = __point_Y(newPosition);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16655
	if (__bothSmallInteger(xpos, ypos)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16656
	    SetCursorPos(__intVal(xpos), __intVal(ypos));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16657
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16658
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16659
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16660
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16661
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16662
setPointerPosition:newPosition in:aWindowId
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16663
    "change the pointer position to a new position relative to the
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16664
     given windows origin (which may be the rootWindow).
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16665
     Be careful with this - its usually not very ergonimically
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16666
     to change the mousePointer position.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16667
     This interface is provided for special applications (presentation
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16668
     playback) and should not be used in normal applications."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16669
3895
31caf29bcda1 there is no setCursorPosition (?!)
Claus Gittinger <cg@exept.de>
parents: 3850
diff changeset
 16670
"/    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
 16671
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16672
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16673
!WinWorkstation methodsFor:'private error handling'!
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16674
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16675
textOutFailed
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16676
    "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
 16677
     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
 16678
     GetLastError is 5"
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16679
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16680
    "/ self error:'textOut failed'.
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16681
! !
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16682
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16683
!WinWorkstation methodsFor:'retrieving pixels'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16684
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16685
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
 16686
    "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
 16687
     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
 16688
     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
 16689
     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
 16690
     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
 16691
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16692
    |error bytesPerLine bitmapPad bitsPerPixel|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16693
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16694
    ((w <= 0) or:[h <= 0]) ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16695
	^ self primitiveFailed:'zero width or height'.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16696
    ].
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16697
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16698
%{
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16699
    int     height, width;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16700
    unsigned int numBytes;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16701
    int     bytesPerRow;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16702
    HWND    hWnd;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16703
    HBITMAP hBitmap = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16704
    HGDIOBJ hPrevious = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16705
    HDC     bDC = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16706
    struct {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16707
	BITMAPINFOHEADER bmiHeader;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16708
	DWORD r;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16709
	DWORD g;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16710
	DWORD b;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16711
    } bitmap;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16712
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16713
    if (! __isExternalAddress(aDrawableId)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16714
	error = __MKSTRING("externalAddress arg");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16715
	goto out;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16716
    }
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16717
    if (! __bothSmallInteger(srcX, srcY)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16718
	error = __MKSTRING("x,y args");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16719
	goto out;
7991
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 (! __bothSmallInteger(w, h)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16722
	error = __MKSTRING("w,h args");
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 (! __isByteArray(imageBits)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16726
	error = __MKSTRING("imageBits arg");
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
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16730
    {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16731
	hWnd = _HWNDVal( aDrawableId );
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16732
	BMDPRINTF(("primGetBits %x\n",hWnd));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16733
	if ( hWnd != 0 ) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16734
	    HDC wDC;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16735
	    HANDLE prevBitmap;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16736
	    int widthRoundedUpToNextMultipleOf4 = ((width + 3 ) / 4) * 4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16737
	    int widthUsed;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16738
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16739
	    bDC = CreateCompatibleDC(__rootDC);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16740
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16741
	    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
 16742
	    height =  __intVal(h);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16743
	    width  =  __intVal(w);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16744
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16745
	    widthUsed = widthRoundedUpToNextMultipleOf4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16746
	    widthUsed = width;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16747
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16748
	    BMDPRINTF(("width %d height %d\n",width,height));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16749
	    hBitmap = CreateCompatibleBitmap(__rootDC, widthUsed, height);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16750
	    if (!hBitmap) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16751
		error = __MKSTRING("CreateCompatibleBitmap failed");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16752
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16753
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16754
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16755
	    bitmap.bmiHeader.biPlanes = 1;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16756
#ifdef ALWAYSTRUECOLOR
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16757
	    bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16758
	    bytesPerRow = (((width*3) + 3 ) / 4) * 4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16759
#else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16760
	    if (__depth == 24) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16761
		bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16762
		bytesPerRow = (((width*3) + 3 ) / 4) * 4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16763
	    } else if (__depth == 16) {
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16764
# if 0
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16765
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16766
		bitmap.b = 0x001f;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16767
		bitmap.g = 0x07e0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16768
		bitmap.r = 0xf800;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16769
		bytesPerRow = (((width*2) + 1 ) / 4) * 4;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16770
# else
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16771
		bitmap.b = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16772
		bitmap.g = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16773
		bitmap.r = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16774
		bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16775
		bytesPerRow = (((width*3) + 3 ) / 4) * 4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16776
# endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16777
	    }
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16778
#endif /* ALWAYSTRUECOLOR */
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16779
	    bitmap.bmiHeader.biSizeImage = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16780
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16781
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16782
	    bitmap.bmiHeader.biClrUsed = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16783
	    bitmap.bmiHeader.biClrImportant = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16784
	    bitmap.bmiHeader.biBitCount = __depth;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16785
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16786
	    bitmap.bmiHeader.biWidth = widthUsed;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16787
	    bitmap.bmiHeader.biHeight = -height;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16788
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16789
	    wDC = GetDC(hWnd);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16790
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16791
	    hPrevious = SelectObject(bDC, hBitmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16792
	    if (BitBlt(bDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16793
		   0,0,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16794
		   width,height,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16795
		   wDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16796
		   __intVal(srcX), __intVal(srcY),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16797
		   SRCCOPY|CAPTUREBLT)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16798
		 == 0
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16799
		)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16800
	    {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16801
		INFOFPRINTF((stderr, "WinWorkstation [warning]: in primGetBitsFrom: BitBlt\n"));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16802
	    }
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16803
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16804
#ifdef CACHE_LAST_DC
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16805
	    if (lastGcData && (lastGcData->_hDC == wDC)) {
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16806
# ifdef DEBUG_DC_REUSE
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16807
		console_fprintf(stderr, "WinWorkstation [info]: Oops - dont release - cachedDC reuse\n", __LINE__);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16808
# endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16809
	    } else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16810
#endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16811
	    {
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16812
#ifdef CACHE_LAST_WM_PAINT_DC
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16813
		if (last_wm_paint_dc && (last_wm_paint_dc == 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 - last_wm_paint_dc 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
		{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16820
		    ReleaseDC(hWnd, wDC);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16821
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16822
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16823
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16824
	    if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16825
	    {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16826
		error = __MKSTRING("noinfo returned in primGetBits");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16827
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16828
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16829
	    BMDPRINTF(("bitmap info:%d %d %d %d\n",
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16830
			bitmap.bmiHeader.biWidth, bitmap.bmiHeader.biHeight,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16831
			bitmap.bmiHeader.biBitCount, bitmap.bmiHeader.biSizeImage));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16832
	    numBytes = bitmap.bmiHeader.biSizeImage;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16833
	    if ( numBytes != 0 ) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16834
		if (numBytes > __byteArraySize(imageBits)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16835
		    /* imageBits too small */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16836
		    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
 16837
				__byteArraySize(imageBits), numBytes,
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
			     ));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16840
		    error = __MKSTRING("byteArray too small");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16841
		    goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16842
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16843
		BMDPRINTF(("numBytes %d\n",numBytes));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16844
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16845
		bitmap.bmiHeader.biHeight = -height;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16846
		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
 16847
		{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16848
		    error = __MKSTRING("zero bits returned in primGetBits");
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
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16852
		/* swap red and blue (windows delivers BGR) */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16853
		{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16854
		    char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16855
		    int _h;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16856
		    char *rowp = cp;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16857
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16858
		    for (_h=height; _h>0; _h--) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16859
			int _w;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16860
			char *pixel = rowp;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16861
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16862
			for (_w=width; _w>0; _w--) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16863
			    char b;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16864
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16865
			    b = pixel[0];
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16866
			    pixel[0] = pixel[2];
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16867
			    pixel[2] = b;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16868
			    pixel += 3;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16869
			};
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16870
			rowp += bytesPerRow;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16871
		    };
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16872
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16873
	    } else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16874
		error = __MKSTRING("unacceptable bitmap in primGetBits");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16875
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16876
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16877
	} else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16878
	    error = __MKSTRING("unacceptable HWND in primGetBits");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16879
	    goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16880
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16881
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16882
	bytesPerLine = __MKSMALLINT(bytesPerRow);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16883
	bitmapPad = __MKSMALLINT(WIN32PADDING);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16884
	bitsPerPixel = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16885
    }
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16886
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16887
out:
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16888
    if ((hPrevious != NULL) && (bDC != NULL))
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16889
	SelectObject(bDC, hPrevious);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16890
    if (bDC)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16891
	DeleteDC(bDC);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16892
    if (hBitmap)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16893
	_DeleteObject(hBitmap, __LINE__);
7991
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
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16896
    error notNil ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16897
	^ self primitiveFailed:error.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16898
    ].
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16899
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16900
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16901
    ^ IdentityDictionary new
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16902
	    at:#bitOrder put:#msbFirst;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16903
	    at:#depth put:1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16904
	    at:#bytesPerLine put:bytesPerLine;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16905
	    at:#byteOrder put:#lsbFirst;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16906
	    at:#format put:#XYPixmap;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16907
	    at:#bitmapUnit put:0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16908
	    at:#bitmapPad put:bitmapPad;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16909
	    at:#bitsPerPixel put:bitsPerPixel;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16910
	    at:#redMask put:16rFF0000;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16911
	    at:#greenMask put:16r00FF00;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16912
	    at:#blueMask put:16r0000FF;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16913
	    yourself.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16914
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16915
    "Modified (comment): / 28-03-2017 / 14:28:39 / stefan"
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16916
!
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16917
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16918
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
 16919
    "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
 16920
     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
 16921
     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
 16922
     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
 16923
     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
 16924
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16925
    |rawInfo error bytesPerLine format bitmapPad bitsPerPixel|
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16926
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16927
    ((w <= 0) or:[h <= 0]) ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16928
	self primitiveFailed:'zero width or height'.
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16929
	^ nil
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16930
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16931
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16932
    rawInfo := Array new:11.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16933
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16934
%{
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16935
    int            height, width;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16936
    unsigned int   numBytes;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16937
    unsigned char* ep = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16938
    HBITMAP        xBitmap;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16939
    HBITMAP hBitmap = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16940
    HDC bDC = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16941
    HDC xDC = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16942
    struct
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16943
    {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16944
	BITMAPINFOHEADER bmiHeader;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16945
	DWORD rgb[2];
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16946
    } bitmap;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16947
    BITMAP bitmapInfo;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16948
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16949
    if (__isExternalAddress(aDrawableId)
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16950
     && __bothSmallInteger(srcX, srcY)
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16951
     && __bothSmallInteger(w, h)
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16952
     && __isArray(rawInfo) && __arraySize(rawInfo) >= 11
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16953
     && __isByteArray(imageBits))
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16954
    {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16955
	xBitmap = _HBITMAPVAL( aDrawableId );
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16956
	BMDPRINTF(("primGetBitsFromPixmap %x\n",xBitmap));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16957
	if (xBitmap != 0) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16958
	    xDC = GetDC(0);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16959
	    SelectObject(xDC, xBitmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16960
	    GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16961
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16962
	    bDC = CreateCompatibleDC(__rootDC);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16963
	    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
 16964
	    height =  __intVal(h);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16965
	    width  =  __intVal(w);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16966
	    BMDPRINTF(("width %d height %d\n",width,height));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16967
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16968
	    hBitmap = CreateCompatibleBitmap(xDC, width, height);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16969
	    if (!hBitmap) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16970
		error = __MKSTRING("create bitmap failed");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16971
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16972
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16973
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16974
	    SelectObject(bDC,hBitmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16975
	    if (BitBlt(bDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16976
		   0,0,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16977
		   width,height,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16978
		   xDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16979
		   __intVal(srcX), __intVal(srcY),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16980
		   SRCCOPY)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16981
		 == 0
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16982
		)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16983
	    {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16984
		error = __MKSTRING("BitBlt failed");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16985
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16986
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16987
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16988
	    bitmap.bmiHeader.biPlanes = 1;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16989
#ifdef ALWAYSTRUECOLOR
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16990
	    bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16991
#else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16992
	    if (__depth == 24) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16993
		/*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16994
		bitmap.r = 0xff0000;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16995
		bitmap.g = 0x00ff00;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16996
		bitmap.b = 0x0000ff;*/
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16997
		bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16998
	    } else if (__depth == 16) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16999
		bitmap.b = 0x001f;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17000
		bitmap.g = 0x07e0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17001
		bitmap.r = 0xf800;*/
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17002
		bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17003
	    } else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17004
		error = __MKSTRING("primGetBitsFromPixmap: unsupported depth");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17005
		got fail;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17006
	    }
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17007
#endif /* ALWAYSTRUECOLOR */
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17008
	    bitmap.bmiHeader.biSizeImage = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17009
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17010
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17011
	    bitmap.bmiHeader.biClrUsed = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17012
	    bitmap.bmiHeader.biClrImportant = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17013
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17014
	    bitmap.bmiHeader.biWidth = width;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17015
	    bitmap.bmiHeader.biHeight = -height;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17016
	    bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17017
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17018
	    if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17019
	    {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17020
		error = __MKSTRING("GetDIBits failed");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17021
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17022
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17023
	    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
 17024
	    numBytes = bitmap.bmiHeader.biSizeImage;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17025
	    if ( numBytes != 0 ) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17026
		if (numBytes > __byteArraySize(imageBits)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17027
		    /* imageBits too small */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17028
		    error = __MKSTRING("provided byteArray too small");
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(("numBytes %d\n",numBytes));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17032
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17033
		bitmap.bmiHeader.biHeight = -height;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17034
		bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17035
		bitmap.rgb[0] = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17036
		bitmap.rgb[1] = 0xffffff;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17037
		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
 17038
		{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17039
		    BMDPRINTF(("zero bits returned\n"));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17040
		    error = __MKSTRING("zero bits returned");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17041
		    goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17042
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17043
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17044
#if 0
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17045
		{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17046
		    /* swap red and blue (windows delivers BGR) */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17047
		    char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17048
		    int n = numBytes;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17049
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17050
		    for ( ;n > 0; n -= 3, cp += 3) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17051
			  char b = cp[0];
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17052
			  cp[0] = cp[2];
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17053
			  cp[2] = b;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17054
		    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17055
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17056
#endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17057
	    } else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17058
		error = __MKSTRING("unacceptable bitmap (size is 0 bytes)");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17059
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17060
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17061
	} else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17062
	    error = __MKSTRING("unacceptable bitmap (null xBitmap)");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17063
	    goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17064
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17065
	bytesPerLine = __MKSMALLINT(numBytes/height);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17066
	format = (bitmap.bmiHeader.biBitCount == 1) ? @symbol(ZPixmap) : @symbol(XYPixmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17067
	bitmapPad = __MKSMALLINT(WIN32PADDING);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17068
	bitsPerPixel = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17069
    }
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17070
out:
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17071
    if (bDC)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17072
	DeleteDC(bDC);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17073
    if (xDC)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17074
	ReleaseDC(0, xDC); //DeleteDC(xDC);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17075
    if (hBitmap)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17076
	DeleteObject(hBitmap);
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
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17079
    error notNil ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17080
	self primitiveFailed:error.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17081
    ].
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17082
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17083
    ^ IdentityDictionary new
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17084
	    at:#bitOrder put:#msbFirst;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17085
	    at:#depth put:1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17086
	    at:#bytesPerLine put:bytesPerLine;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17087
	    at:#byteOrder put:#lsbFirst;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17088
	    at:#format put:format;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17089
	    at:#bitmapUnit put:0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17090
	    at:#bitmapPad put:bitmapPad;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17091
	    at:#bitsPerPixel put:bitsPerPixel;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17092
	    at:#redMask put:16rFF0000;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17093
	    at:#greenMask put:16r00FF00;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17094
	    at:#blueMask put:16r0000FF;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17095
	    yourself.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17096
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17097
    "Modified (comment): / 28-03-2017 / 14:28:46 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17098
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17099
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 17100
getPixelX:px y:py from:ignoredDrawableId with:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17101
    "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
 17102
     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
 17103
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17104
%{  /* NOCONTEXT */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17105
    if (__isExternalAddress(aGCId)
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17106
     && __bothSmallInteger(px, py)) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17107
	struct gcData *gcData = _GCDATA(aGCId);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17108
	HDC hDC;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17109
	int __x = __intVal(px), __y = __intVal(py);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17110
	int pixel;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17111
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17112
	hDC = _getDC(gcData);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17113
	pixel = GetPixel(hDC, __x, __y);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17114
#ifndef CACHE_LAST_DC
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17115
	_releaseDC(gcData);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17116
#endif
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17117
	/*
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 17118
	 * for compatibility, returns the pixelValue
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17119
	 * from a monochrome bitmap
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17120
	 */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17121
	if (gcData->hBitmap) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17122
	    if (gcData->bitmapColorBitCount == 1) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17123
		pixel = (pixel == 0) ? 0 : 1;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17124
	    }
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17125
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17126
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17127
	RETURN ( __MKSMALLINT(pixel & 0xFFFFFF) );
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
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17130
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17131
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17132
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17133
!WinWorkstation methodsFor:'style defaults'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17134
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17135
defaultStyleValueFor:aKey
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17136
    "return a default style value, given a key.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17137
     These defaults are used if nothing is specified
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17138
     in the style sheet
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17139
     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
 17140
     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
 17141
     where the systemDefaults are used ..."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17142
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17143
    |clr|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17144
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17145
"/    aKey == #shadowColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17146
"/        ^ Color black
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17147
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17148
"/    aKey == #lightColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17149
"/        ^ Color white
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
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17152
    aKey == #viewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17153
	clr := self getSystemColor:#COLOR_WINDOW.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17154
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17155
    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17156
	clr := self getSystemColor:#COLOR_WINDOWTEXT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17157
    ].
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 == #scrollerViewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17161
"/        ^ Color white
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
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17164
"/    aKey == #textBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17165
"/        ^ Color white.
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
    clr notNil ifTrue:[^ clr].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17169
    ^ super defaultStyleValueFor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17170
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17171
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17172
!WinWorkstation methodsFor:'tray access'!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17173
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17174
addTrayIconFor:aView
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17175
	icon:wicon iconMask:wiconMaskArg
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17176
	toolTipMessage:toolTipMessageArg
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17177
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17178
    "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
 17179
     The icon, mask and toolTopText are optional.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17180
     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
 17181
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17182
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17183
     wiconWidth wiconHeight toolTipMessage|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17184
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17185
    "/ 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
 17186
    toolTipMessageArg size > 63 ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17187
	toolTipMessage := toolTipMessageArg copyTo:63
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17188
    ] ifFalse:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17189
	toolTipMessage := toolTipMessageArg.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17190
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17191
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17192
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17193
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17194
    wicon notNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17195
	wiconId := (wicon asFormOn:self) id.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17196
	wiconHeight := wicon height.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17197
	wiconWidth  := wicon width.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17198
	wiconMask := wiconMaskArg.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17199
	wiconMask isNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17200
	    wiconMask := wicon mask.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17201
	].
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17202
	wiconMask notNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17203
	    "/ WIN32's mask has zeros for opaque pixels
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17204
	    invertedWiconMask := wiconMask copy.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17205
	    invertedWiconMask bits invert.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17206
	    invertedWiconMask := invertedWiconMask onDevice:self.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17207
	    wiconMaskId := invertedWiconMask id
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17208
	].
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17209
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17210
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17211
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17212
#ifndef WM_TRAY_MESSAGE
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17213
# define WM_TRAY_MESSAGE (WM_USER+0x200)
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17214
#endif
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17215
    HBITMAP        xBitMap, maskBitmap;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17216
    HICON          xIcon = (HICON)0;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17217
    ICONINFO       iconInfo;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17218
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17219
    unsigned char fastBits[10000];
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17220
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17221
    /* get bitmap for icon */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17222
    if ( __isExternalAddress(wiconId) ) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17223
	xBitMap = _HBITMAPVAL( wiconId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17224
	if ( xBitMap != 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17225
	    BITMAP bm;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17226
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17227
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17228
		int d = bm.bmPlanes * bm.bmBitsPixel;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17229
		BYTE *ep;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17230
		int height, width;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17231
		int nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17232
		unsigned char *allocatedBits = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17233
		int privateMask = 0;
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 ( __isExternalAddress(wiconMaskId) ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17236
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17237
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17238
		    if (wiconMaskId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17239
			PRINTF(("WinWorkstat [warning]: wiconMaskId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17240
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17241
		    maskBitmap = 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
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17244
		/*
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17245
		 * if there is no mask, generate one
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17246
		 */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17247
		if (maskBitmap == 0) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17248
		    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
 17249
		    height = __intVal( wiconHeight );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17250
		    width  = __intVal( wiconWidth  );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17251
		    nBytes = ( width + 15 ) / 8;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17252
		    nBytes = height * nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17253
		    if (nBytes < sizeof(fastBits)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17254
			ep = fastBits;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17255
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17256
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17257
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17258
		    if ( ep == 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17259
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17260
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17261
			memset(ep, 0, nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17262
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17263
			if ( maskBitmap == NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17264
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17265
			} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17266
			    privateMask = 1;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17267
			}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17268
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17269
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17270
		if ( maskBitmap != NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17271
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17272
		    iconInfo.fIcon = TRUE;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17273
		    iconInfo.hbmMask  = maskBitmap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17274
		    iconInfo.hbmColor = xBitMap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17275
		    xIcon = CreateIconIndirect( &iconInfo );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17276
		    if (privateMask) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17277
			DeleteObject( maskBitmap );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17278
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17279
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17280
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17281
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17282
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17283
		if (allocatedBits) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17284
		    free(allocatedBits);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17285
		}
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
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17289
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17290
    } else {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17291
	if (wiconId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17292
	    PRINTF(("WinWorkstat [warning]: wiconId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17293
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17294
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17295
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17296
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17297
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17298
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17299
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17300
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17301
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17302
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17303
	    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
 17304
			     // 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
 17305
	    nid.uFlags =
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17306
		NIF_ICON        //we're adding an icon
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17307
		| 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
 17308
		| NIF_TIP;      //our icon has a tooltip.
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
	    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
 17311
	    if (xIcon) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17312
		nid.hIcon   = xIcon;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17313
		/* 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
 17314
	    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17315
		nid.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17316
	    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 17317
	    if (__isStringLike(toolTipMessage)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17318
		strcpy(nid.szTip, __stringVal(toolTipMessage));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17319
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17320
	    Shell_NotifyIcon(NIM_ADD, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17321
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17322
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17323
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17324
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17325
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17326
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17327
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17328
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17329
     v openAndWait.
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
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17332
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17333
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17334
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17335
	  toolTipMessage:'Hi There'
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17336
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17337
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17338
    "Created: / 31-10-2007 / 01:51:49 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17339
    "Modified: / 05-11-2007 / 12:18:54 / cg"
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17340
!
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17341
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17342
removeTrayIconFor:aView
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17343
    "remove the tray icon"
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17344
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17345
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17346
     wiconWidth wiconHeight|
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17347
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17348
    windowId := aView id.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17349
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17350
%{  /* STACK: 20000 */
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17351
#ifndef WM_TRAY_MESSAGE
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17352
# define WM_TRAY_MESSAGE (WM_USER+0x200)
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17353
#endif
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17354
    NOTIFYICONDATA nid;
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17355
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17356
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17357
    nid.cbSize = sizeof(NOTIFYICONDATA);
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17358
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17359
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17360
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17361
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17362
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17363
	    nid.hWnd = hwnd;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17364
	    Shell_NotifyIcon(NIM_DELETE, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17365
	}
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17366
    }
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17367
%}
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17368
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17369
    "
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17370
     |v icon|
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17371
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17372
     v := StandardSystemView new.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17373
     v openAndWait.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17374
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17375
     icon := Icon stxIcon.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17376
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17377
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17378
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17379
	  toolTipMessage:'Hi There'.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17380
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17381
     Delay waitForSeconds:3.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17382
     icon := Tools::NewSystemBrowser defaultIcon.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17383
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17384
	  setTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17385
	  icon:icon iconMask:nil.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17386
     Delay waitForSeconds:3.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17387
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17388
	    removeTrayIconFor:v.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17389
    "
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17390
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17391
    "Created: / 05-11-2007 / 12:17:17 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17392
!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17393
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17394
setTrayIconFor:aView icon:wicon iconMask:wiconMaskArg
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17395
    "change the tray icon"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17396
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17397
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17398
     wiconWidth wiconHeight|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17399
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17400
    windowId := aView id.
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
    wicon notNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17403
	wiconId := (wicon asFormOn:self) id.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17404
	wiconHeight := wicon height.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17405
	wiconWidth  := wicon width.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17406
	wiconMask := wiconMaskArg.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17407
	wiconMask isNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17408
	    wiconMask := wicon mask.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17409
	].
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17410
	wiconMask notNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17411
	    "/ WIN32's mask has zeros for opaque pixels
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17412
	    invertedWiconMask := wiconMask copy.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17413
	    invertedWiconMask bits invert.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17414
	    invertedWiconMask := invertedWiconMask onDevice:self.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17415
	    wiconMaskId := invertedWiconMask id
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17416
	].
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17417
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17418
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17419
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17420
#ifndef WM_TRAY_MESSAGE
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17421
# define WM_TRAY_MESSAGE (WM_USER+0x200)
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17422
#endif
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17423
    HBITMAP        xBitMap, maskBitmap;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17424
    HICON          xIcon = (HICON)0;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17425
    ICONINFO       iconInfo;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17426
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17427
    unsigned char fastBits[10000];
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17428
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17429
    /* get bitmap for icon */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17430
    if ( __isExternalAddress(wiconId) ) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17431
	xBitMap = _HBITMAPVAL( wiconId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17432
	if ( xBitMap != 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17433
	    BITMAP bm;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17434
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17435
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17436
		int d = bm.bmPlanes * bm.bmBitsPixel;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17437
		BYTE *ep;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17438
		int height, width;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17439
		int nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17440
		unsigned char *allocatedBits = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17441
		int privateMask = 0;
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 ( __isExternalAddress(wiconMaskId) ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17444
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17445
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17446
		    if (wiconMaskId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17447
			PRINTF(("WinWorkstat [warning]: wiconMaskId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17448
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17449
		    maskBitmap = 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
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17452
		/*
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17453
		 * if there is no mask, generate one
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17454
		 */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17455
		if (maskBitmap == 0) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17456
		    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
 17457
		    height = __intVal( wiconHeight );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17458
		    width  = __intVal( wiconWidth  );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17459
		    nBytes = ( width + 15 ) / 8;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17460
		    nBytes = height * nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17461
		    if (nBytes < sizeof(fastBits)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17462
			ep = fastBits;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17463
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17464
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17465
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17466
		    if ( ep == 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17467
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17468
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17469
			memset(ep, 0, nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17470
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17471
			if ( maskBitmap == NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17472
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17473
			} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17474
			    privateMask = 1;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17475
			}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17476
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17477
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17478
		if ( maskBitmap != NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17479
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17480
		    iconInfo.fIcon = TRUE;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17481
		    iconInfo.hbmMask  = maskBitmap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17482
		    iconInfo.hbmColor = xBitMap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17483
		    xIcon = CreateIconIndirect( &iconInfo );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17484
		    if (privateMask) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17485
			DeleteObject( maskBitmap );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17486
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17487
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17488
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17489
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17490
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17491
		if (allocatedBits) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17492
		    free(allocatedBits);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17493
		}
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
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17497
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17498
    } else {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17499
	if (wiconId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17500
	    PRINTF(("WinWorkstat [warning]: wiconId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17501
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17502
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17503
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17504
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17505
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17506
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17507
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17508
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17509
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17510
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17511
	    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
 17512
			     // 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
 17513
	    nid.uFlags = NIF_ICON;      //our icon has a tooltip.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17514
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17515
	    if (xIcon) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17516
		nid.hIcon   = xIcon;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17517
		/* 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
 17518
	    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17519
		nid.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17520
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17521
	    Shell_NotifyIcon(NIM_MODIFY, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17522
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17523
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17524
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17525
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17526
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17527
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17528
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17529
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17530
     v openAndWait.
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
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17533
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17534
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17535
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17536
	  toolTipMessage:'Hi There'.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17537
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17538
     Delay waitForSeconds:3.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17539
     icon := Tools::NewSystemBrowser defaultIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17540
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17541
	  setTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17542
	  icon:icon iconMask:nil.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17543
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17544
    "
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
    "Created: / 31-10-2007 / 11:41:33 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17547
    "Modified: / 05-11-2007 / 12:19:12 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17548
!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17549
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17550
setTrayIconsToolTipMessageFor:aView to:toolTipMessageArg
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17551
    "Change the toolTopText.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17552
     Windows seems to have a bug here, in that while being shown,
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17553
     a change of the toolTipText is not immediately visible
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17554
     (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
 17555
     and reopened)
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17556
     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
 17557
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17558
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17559
     wiconWidth wiconHeight toolTipMessage|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17560
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17561
    "/ 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
 17562
    toolTipMessageArg size > 63 ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17563
	toolTipMessage := toolTipMessageArg copyTo:63
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17564
    ] ifFalse:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17565
	toolTipMessage := toolTipMessageArg.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17566
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17567
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17568
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17569
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17570
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17571
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17572
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17573
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17574
    nid.cbSize = sizeof(NOTIFYICONDATA);
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
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17577
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17578
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17579
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17580
	    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
 17581
			     // 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
 17582
	    nid.uFlags = NIF_TIP;    //change the tooltip.
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 17583
	    if (__isStringLike(toolTipMessage)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17584
		strcpy(nid.szTip, __stringVal(toolTipMessage));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17585
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17586
	    Shell_NotifyIcon(NIM_MODIFY, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17587
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17588
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17589
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17590
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17591
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17592
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17593
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17594
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17595
     v openAndWait.
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
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17598
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17599
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17600
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17601
	  toolTipMessage:'Hi There'.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17602
     1 to:5 do:[:i |
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17603
	 Delay waitForSeconds:2.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17604
	 Screen current
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17605
	      setTrayIconsToolTipMessageFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17606
	      to:(i printString).
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17607
     ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17608
     v destroy.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17609
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17610
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17611
    "Created: / 31-10-2007 / 11:25:49 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17612
    "Modified: / 05-11-2007 / 12:20:53 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17613
! !
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17614
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17615
!WinWorkstation methodsFor:'window stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17616
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17617
activateWindow1:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 17618
    "make a window active (so that it gets the focus)"
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17619
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17620
%{  /* NOCONTEXT */
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17621
    if (__isExternalAddress(aWindowId)) {
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17622
	HWND win = _HWNDVal(aWindowId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17623
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17624
	if (win) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17625
	    CPRINTF(("activateWindow %x\n",win));
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4351
diff changeset
 17626
#if 0
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17627
	    ShowWindowAsync(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17628
#else
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17629
	    ShowWindow(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17630
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17631
	}
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17632
    }
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17633
%}
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17634
!
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17635
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17636
activateWindow2:aWindowId
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17637
    "make a window active (so that it gets the focus).
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17638
     Paranoid implementation."
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17639
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17640
%{  /* NOCONTEXT */
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17641
    if (__isExternalAddress(aWindowId)) {
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17642
	HWND win = _HWNDVal(aWindowId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17643
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17644
	if (win) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17645
	    DWORD activeThreadID, activeProcessID;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17646
	    DWORD myThreadID;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17647
	    HWND foregroundWindow = GetForegroundWindow();
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17648
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17649
	    if (foregroundWindow) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17650
		activeThreadID = GetWindowThreadProcessId(foregroundWindow, &activeProcessID);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17651
		myThreadID = GetCurrentThreadId();
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17652
		AttachThreadInput(activeThreadID, myThreadID, TRUE);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17653
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17654
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17655
	    // Do our stuff here ;-)
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17656
	    ShowWindow(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17657
	    SetForegroundWindow(win);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17658
	    SetFocus(win);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17659
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17660
	    if (foregroundWindow) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17661
		AttachThreadInput(activeThreadID, myThreadID, FALSE);
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
	}
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17664
    }
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17665
%}
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17666
!
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17667
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17668
activateWindow:aWindowId
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17669
    "make a window active (so that it gets the focus)"
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17670
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17671
    "/ 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
 17672
    "/ we might try activate2 there.
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17673
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17674
    "/ self activateWindow1:aWindowId
6590
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 17675
    self activateWindow2:aWindowId.
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17676
!
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17677
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17678
animateWindow:aWindowId show:doShow animation:animationSymbolorNil time:timeInMillisOrNil
4491
c011e738596f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4490
diff changeset
 17679
    "make a window visible/invisible with animation effect.
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17680
     CAVEAT:
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17681
	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
 17682
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17683
%{
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17684
    if (__isExternalAddress(aWindowId)) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17685
	HWND hWnd = _HWNDVal(aWindowId);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17686
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17687
	if (hWnd) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17688
	    DWORD how = (doShow == true) ? AW_ACTIVATE : AW_HIDE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17689
	    DWORD time = 0;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17690
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17691
	    CPRINTF(("mapWindowAnimated %x\n", hWnd));
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17692
	    if (animationSymbolorNil != nil) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17693
		if (__isSmallInteger(timeInMillisOrNil)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17694
		    time = __intVal(timeInMillisOrNil);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17695
		}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17696
		if (animationSymbolorNil == @symbol(SLIDE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17697
		    how |= AW_SLIDE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17698
		} else if (animationSymbolorNil == @symbol(BLEND)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17699
		    how |= AW_BLEND;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17700
		} else if (animationSymbolorNil == @symbol(CENTER)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17701
		    how |= AW_CENTER;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17702
		} else if (animationSymbolorNil == @symbol(HOR_POSITIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17703
		    how |= AW_HOR_POSITIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17704
		} else if (animationSymbolorNil == @symbol(HOR_NEGATIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17705
		    how |= AW_HOR_NEGATIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17706
		} else if (animationSymbolorNil == @symbol(VER_POSITIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17707
		    how |= AW_VER_POSITIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17708
		} else if (animationSymbolorNil == @symbol(VER_NEGATIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17709
		    how |= AW_VER_NEGATIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17710
		}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17711
	    }
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17712
	    AnimateWindow(hWnd, time, how);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17713
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17714
	RETURN ( self );
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17715
    }
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17716
%}
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17717
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17718
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17719
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17720
    "configure stacking operation of aWindowId w.r.t siblingId"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17721
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17722
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17723
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17724
dropFilesWindow:aWindowId accept:doAccept
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17725
    "window accept Files from Shell"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17726
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17727
%{  /*  */
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17728
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17729
    if (__isExternalAddress(aWindowId)) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17730
	HWND hWnd = _HWNDVal(aWindowId);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17731
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17732
	if (hWnd) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17733
	    if (doAccept == true)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17734
	    DragAcceptFiles(hWnd, (doAccept == true) ? TRUE : FALSE);
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17735
	}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17736
	RETURN ( self );
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17737
    }
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17738
%}
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
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17741
findWindow:lpClassName windowName:lpWindowName
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 17742
    "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
 17743
     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
 17744
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 17745
    ((lpClassName notNil and:[lpClassName isWideString])
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 17746
     or:[lpWindowName notNil and:[lpWindowName isWideString]]) ifTrue:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17747
	^ self
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17748
	    primFindWindowW:(lpClassName isNil
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17749
				    ifTrue:[nil]
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17750
				    ifFalse:[lpClassName asUnicode16StringZ])
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17751
	    windowName:(lpWindowName isNil
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17752
				    ifTrue:[nil]
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17753
				    ifFalse:[lpWindowName asUnicode16StringZ])
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17754
    ].
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17755
    ^ self primFindWindowA:lpClassName windowName:lpWindowName
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17756
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17757
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17758
     |h|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17759
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17760
     h := Screen current findWindow:'Shell_TrayWnd' windowName:''.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17761
     Screen current prim_getWindowRect:h.
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17762
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17763
     Display findWindow:nil windowName:'ST/X Launcher'
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
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17767
getParentWindowIdOfWindowId:aChildWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17768
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17769
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17770
    if (__isExternalAddress(aChildWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17771
	HWND wChild = _HWNDVal(aChildWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17772
	HWND wParent;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17773
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17774
	if (wChild) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17775
	    wParent = GetParent(wChild);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17776
	    if (wParent) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17777
		RETURN ( __MKEXTERNALADDRESS(wParent) );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17778
	    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17779
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17780
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17781
%}.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17782
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17783
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17784
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17785
     |top v|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17786
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17787
     top := View new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17788
     v := View in:top.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17789
     top realize.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17790
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17791
     self assert:(Display getParentWindowIdOfWindowId:(v id)) = top id.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17792
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17793
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17794
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17795
getThreadIdOfWindowId:windowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17796
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17797
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17798
    if (__isExternalAddress(windowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17799
	HWND hwnd = _HWNDVal(windowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17800
	DWORD id;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17801
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17802
	if (hwnd) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17803
	    id = GetWindowThreadProcessId(hwnd, &id);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17804
	    RETURN ( __MKEXTERNALADDRESS(id) );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17805
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17806
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17807
%}.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17808
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17810
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17811
     |top|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17812
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17813
     top := View new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17814
     top realize.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17815
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17816
     self assert:(Display getThreadIdOfWindowId:(top id)) = OperatingSystem getProcessId.
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
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17820
getWindowClassName:aWindowId
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17821
    "get a (possibly alien) window's class name"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17822
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17823
    |buffer n|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17824
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17825
    buffer := Unicode16String new:200.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17826
    n := self primGetWindowClassW:aWindowId into:buffer size:200.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17827
    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
 17828
	^ (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
 17829
    ].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17830
    self primitiveFailed.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17831
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17832
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17833
     |h|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17834
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17835
     h := Display findWindow:nil windowName:'ST/X Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17836
     Display getWindowClassName:h.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17837
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17838
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17839
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17840
     |h|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17841
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17842
     h := Display findWindow:nil windowName:'ST/XX Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17843
     Display getWindowText:h.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17844
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17845
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17846
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17847
getWindowIdFromThreadId:id
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17848
    |l|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17849
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17850
    l := OrderedCollection new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17851
    self primEnumWindowsInto:l.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17852
    l do:[:eachWindowId |
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17853
	(self getParentWindowIdOfWindowId:eachWindowId) isNil ifTrue:[
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17854
	    "/ a topView
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17855
	    (self getThreadIdOfWindowId:eachWindowId) = id ifTrue:[
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17856
		^ eachWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17857
	    ].
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17858
	]
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17859
    ].
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17860
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17861
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17862
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17863
     Display getWindowIdFromThreadId:(OperatingSystem getProcessId)
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17864
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17865
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17866
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17867
getWindowRectangle:aWindowId
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17868
    "get a (possibly alien) window's screen rectangle"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17869
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17870
    |bytes|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17871
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17872
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17873
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17874
    bytes := ByteArray new:(ExternalBytes sizeofLong*4).
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17875
    self primGetWindowRect:aWindowId lpRect:bytes.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17876
    ^ Rectangle
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17877
	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
 17878
	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
 17879
	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
 17880
	bottom:(bytes longAt:13)
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17881
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17882
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17883
     |handle|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17884
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17885
     handle := Display findWindow: nil windowName: 'ST/X Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17886
     (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
 17887
     Display getWindowRectangle:handle.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17888
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17889
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17890
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17891
getWindowText:aWindowId
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17892
    "get a (possibly alien) window's title text"
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17893
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17894
    |buffer n|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17895
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17896
    buffer := Unicode16String new:200.
5334
da0ae55ea30f code cleanup
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
 17897
    n := self primGetWindowTextW:aWindowId into:buffer size:200.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17898
    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
 17899
	^ (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
 17900
    ].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17901
    self primitiveFailed.
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17902
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
     |h|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17905
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17906
     h := Display findWindow:nil windowName:'ST/X Launcher'.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17907
     Display getWindowText:h.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17908
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17909
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
     |h|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17912
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17913
     h := Display findWindow:nil windowName:'ST/XX Launcher'.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17914
     Display getWindowText:h.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17915
    "
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
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17918
isValidWindowId:aWindowId
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17919
    "return true, if the given window ID is (still) valid.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17920
     Especially useful, if the passed windowID is
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17921
     an alien (external) windows id."
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17922
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 17923
%{  /* NOCONTEXT */
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17924
    if (__isExternalAddress(aWindowId)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17925
	HWND win = _HWNDVal(aWindowId);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17926
	DWORD threadID, processID = 0;
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17927
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17928
	if (! IsWindow(win)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17929
	    RETURN (false);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17930
	}
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17931
	threadID = GetWindowThreadProcessId(win, &processID);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17932
	if ((threadID==0) || (processID==0)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17933
	    RETURN (false);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17934
	}
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17935
	RETURN (true);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17936
    }
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17937
%}.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17938
    self primitiveFailed.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17939
    ^ false
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17940
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17941
    "
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17942
     |v aWindowId ok|
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17943
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17944
     v := StandardSystemView new.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17945
     v label:'hello'.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17946
     v openAndWait.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17947
     aWindowId := v id.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17948
     ok := Display isValidWindowId:aWindowId.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17949
     Transcript showCR:'ok is: ' , ok printString.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17950
     Delay waitForSeconds:1.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17951
     v destroy.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17952
     Delay waitForSeconds:0.5.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17953
     ok := Display isValidWindowId:aWindowId.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17954
     Transcript showCR:'ok is: ' , ok printString.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17955
    "
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17956
!
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17957
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17958
lowerWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17959
    "bring a window to back"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17960
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17961
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17962
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17963
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17964
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17965
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17966
	if (win) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 17967
	    CPRINTF(("lowerWindow %x\n",win));
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17968
	    SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 17969
			 SWP_NOSENDCHANGING |
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 17970
			 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17971
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17972
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17973
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17974
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17975
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17976
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17977
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
 17978
    "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
 17979
     in addition, allow change of extend, position, minExtend and maxExtent.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17980
     Needed for restart, to allow recreating a view as iconified,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17981
     and to collaps/expand windows."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17982
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17983
    |minW minH maxW maxH|
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17984
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17985
    minExt notNil ifTrue:[
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17986
	minW := minExt x.
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17987
	minH := minExt y.
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17988
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17989
    maxExt notNil ifTrue:[
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17990
	maxW := maxExt x.
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17991
	maxH := maxExt y.
2653
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
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17994
%{
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17995
    if (__isExternalAddress(aWindowId)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17996
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17997
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17998
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17999
	    int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18000
	    int flag = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18001
	    int __left, __top, __width, __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18002
	    int winStyleBits;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18003
	    int winExStyleBits;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18004
	    localWindowInfo *lI;
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
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18007
	    winStyleBits = GetWindowLong(win, GWL_STYLE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18008
	    winExStyleBits = GetWindowLong(win, GWL_EXSTYLE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18009
	    lI = GETLOCALWINDOWINFOPTR(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18010
	    if (! lI) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18011
		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
 18012
		RETURN (self);
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
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18015
	    if (__bothSmallInteger(x, y)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18016
		__left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18017
		__top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18018
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18019
		__left = __top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18020
		flag |= SWP_NOMOVE;
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
	    if (__bothSmallInteger(w, h)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18023
		__width = __intVal(w) - bw - bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18024
		__height = __intVal(h) - bw - bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18025
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18026
		__width = __height = 100;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18027
		flag |= SWP_NOSIZE;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18028
	    }
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(minW, minH)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18031
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18032
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18033
		rec.left = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18034
		rec.top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18035
		rec.right = __intVal(minW);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18036
		rec.bottom = __intVal(minH);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18037
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18038
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18039
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18040
		lI->minWidth = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18041
		lI->minHeight = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18042
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18043
	    if (__bothSmallInteger(maxW, maxH)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18044
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18045
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18046
		rec.left = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18047
		rec.top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18048
		rec.right = __intVal(maxW);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18049
		rec.bottom = __intVal(maxH);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18050
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18051
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18052
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18053
		lI->maxWidth = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18054
		lI->maxHeight = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18055
	    }
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18056
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18057
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18058
	    if (flag != (SWP_NOMOVE | SWP_NOSIZE)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18059
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18060
		int __left0, __top0, __width0, __height0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18061
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18062
		__left0   = __left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18063
		__top0    = __top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18064
		__width0  = __width;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18065
		__height0 = __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18066
5545
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 18067
		rec.left = __left;
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 18068
		// rec.left = __left-2;
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 18069
		rec.top = __top;
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 18070
		// rec.top = __top-2;
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18071
		rec.right = rec.left + __width;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18072
		rec.bottom = rec.top + __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18073
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18074
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18075
		__left = rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18076
		__top = rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18077
		__width = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18078
		__height = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18079
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18080
		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
 18081
			 win,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18082
			 __left0, __top0, __width0, __height0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18083
			 __left, __top, __width, __height));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18084
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18085
#else
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18086
	    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
 18087
		     win,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18088
		     __left, __top, __width, __height));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18089
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18090
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18091
	    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
 18092
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18093
	    if (aBoolean == true) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18094
		/* iconified */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18095
//              SetWindowPos(win, (HWND)0,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18096
//                           __left, __top, __width, __height,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18097
//                           flag);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18098
//                ShowWindow(win, SW_SHOWMINIMIZED);
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18099
		ShowWindowAsync(win, SW_SHOWMINNOACTIVE);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 18100
/*
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18101
		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
 18102
*/
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18103
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18104
		/* normal */
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18105
		SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18106
			     __left, __top, __width, __height,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18107
			     flag);
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, 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
 18110
*/
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18111
		//ShowWindow(win, SW_RESTORE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18112
		// ShowWindowAsync(win, SW_RESTORE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18113
		ShowWindowAsync(win, SW_SHOWNOACTIVATE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18114
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18115
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18116
	RETURN ( self );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18117
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18118
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18119
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18120
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18121
mapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18122
    "make a window visible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18123
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18124
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18125
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18126
    if (__isExternalAddress(aWindowId)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18127
	HWND hWnd = _HWNDVal(aWindowId);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18128
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18129
	if (hWnd) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18130
	    CPRINTF(("mapWindow %x\n", hWnd));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18131
	    if (GetParent(hWnd) == 0) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18132
		ShowWindowAsync(hWnd, SW_SHOWNOACTIVATE);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18133
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18134
		ShowWindowAsync(hWnd, SW_SHOWNORMAL);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18135
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18136
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18137
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18138
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18139
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18140
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18141
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18142
mapWindow:aWindowId animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18143
    "make a window visible with some animation effect"
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18144
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18145
    self animateWindow:aWindowId show:true animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18146
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18147
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18148
moveResizeWindow:aWindowId x:x y:y width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18149
    "move and resize a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18150
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18151
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18152
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18153
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18154
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18155
     && __bothSmallInteger(w, h)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18156
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18157
	int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18158
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18159
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18160
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18161
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18162
	    rec.left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18163
	    rec.top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18164
	    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
 18165
	    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
 18166
	    if (GetParent(win) == 0) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18167
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18168
		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
 18169
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18170
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18171
	    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
 18172
			 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
 18173
	    SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18174
			 rec.left, rec.top,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18175
			 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
 18176
			 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
 18177
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18178
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18179
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18180
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18181
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18182
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18183
moveWindow:aWindowId x:x y:y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18184
    "move a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18185
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18186
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18187
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18188
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18189
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18190
     && __bothSmallInteger(x, y)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18191
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18192
	int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18193
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18194
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18195
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18196
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18197
	    rec.left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18198
	    rec.top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18199
	    if (GetParent(win) == 0) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18200
		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
 18201
		rec.bottom = rec.top + 10;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18202
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18203
		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
 18204
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18205
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18206
	    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
 18207
			__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
 18208
	    SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18209
			 rec.left, rec.top,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18210
			 0, 0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18211
			 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
 18212
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18213
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18214
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18215
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18216
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18217
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18218
primEnumChildWindowsOf:aWindowId into:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18219
%{
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18220
    if (__isExternalAddress(aWindowId)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18221
	HWND hwParent = _HWNDVal(aWindowId);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18222
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18223
	if ( EnumChildWindows( hwParent, EnumWindowsProc, (INT)&(handleList))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18224
	    DPRINTF(("EnumChildWindows successful\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18225
	}
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18226
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18227
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18228
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18229
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18230
primEnumWindowsInto:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18231
%{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18232
    if ( EnumWindows( EnumWindowsProc, (INT)&(handleList))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18233
	DPRINTF(("EnumWindows successful\n"));
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18234
    }
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18235
%}
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18236
!
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18237
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18238
primEnumWindowsOf:threadId into:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18239
%{
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18240
    if (__isSmallInteger(threadId)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18241
	if ( EnumThreadWindows( __intVal(threadId), EnumWindowsProc, (INT)&(handleList))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18242
	    DPRINTF(("EnumThreadWindows successful\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18243
	}
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18244
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18245
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18246
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18247
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18248
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
 18249
    "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
 18250
     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
 18251
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18252
    <apicall: handle "FindWindowA" (lpstr lpstr) module: "user32.dll" >
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18253
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18254
    "
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18255
     Display primFindWindowA: nil windowName: 'ST/X Launcher'
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18256
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18257
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18258
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18259
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
 18260
    "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
 18261
     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
 18262
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18263
    <apicall: handle "FindWindowW" (pointer pointer) module: "user32.dll" >
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18264
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18265
    "
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 18266
     Display primFindWindowW: nil windowName: 'ST/X Launcher' asUnicode16String
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18267
    "
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18268
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18269
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18270
primGetWindowClassW:aWindowId into:buffer size:maxSize
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18271
    "get a window's class name"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18272
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18273
    <apicall: int "GetClassNameW" (handle, pointer, int) module: "user32.dll" >
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18274
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18275
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18276
primGetWindowRect:aWindowId lpRect:lpRect
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18277
    "get a window's screen rectangle"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18278
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18279
    <apicall: int "GetWindowRect" (handle, pointer) module: "user32.dll" >
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18280
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18281
5334
da0ae55ea30f code cleanup
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
 18282
primGetWindowTextW:aWindowId into:buffer size:maxSize
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18283
    "get a window's title text"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18284
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18285
    <apicall: int "GetWindowTextW" (handle, pointer, int) module: "user32.dll" >
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18286
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18287
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18288
primSendMessage:aWindowId message:message wParam:wParam lParam:lParam
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18289
    "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
 18290
     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
 18291
     does not return until the target's window procedure has processed the message."
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18292
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18293
    <apicall: bool "SendMessageA" (handle uint pointer pointer) module: "user32.dll" >
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18294
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18295
5027
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18296
primSetForegroundWindow: aWindowId
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18297
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18298
    "
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18299
    If the window was brought to the foreground, the return value is nonzero.
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18300
    If the window was not brought to the foreground, the return value is zero.
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18301
    "
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18302
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18303
    <apicall: bool "SetForegroundWindow" (handle) module: "user32.dll" >
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18304
!
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18305
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18306
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
 18307
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18308
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18309
    HBITMAP        xBitMap, maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18310
    ICONINFO       iconInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18311
    int            height, width;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18312
    HICON          xIcon = (HICON)0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18313
    unsigned char  fastBits[10000];
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18314
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18315
    DPRINTF(("primSetWindowIconId\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18316
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18317
     && __isExternalAddress(wiconId)
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18318
     && __bothSmallInteger(wiconWidth, wiconHeight)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18319
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18320
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18321
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18322
	if ( xBitMap != 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18323
	    BITMAP bm;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18324
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18325
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18326
		BYTE *ep;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18327
		int privateMask = 0;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
 18328
		unsigned char  *allocatedBits = 0;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18329
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18330
		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
 18331
		height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18332
		width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18333
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18334
		if ( __isExternalAddress(wmaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18335
		    maskBitmap = _HBITMAPVAL( wmaskId );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18336
		} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18337
		    if (wmaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18338
			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
 18339
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18340
		    maskBitmap = 0;
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
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18343
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18344
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18345
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18346
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18347
		    int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18348
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18349
		    nBytes = ( width + 31 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18350
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18351
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18352
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18353
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18354
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18355
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18356
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18357
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18358
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18359
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18360
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18361
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18362
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18363
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18364
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18365
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18366
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18367
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18368
		if ( maskBitmap != NULL ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18369
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18370
		    iconInfo.fIcon = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18371
		    iconInfo.hbmMask  =maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18372
		    iconInfo.hbmColor = xBitMap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18373
		    xIcon = CreateIconIndirect( &iconInfo );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18374
		    DPRINTF(( "ICON CREATED!!!\n" ));
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18375
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 18376
			_DeleteObject( maskBitmap, __LINE__ );
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18377
		    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18378
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18379
		    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
 18380
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18381
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18382
		if (allocatedBits) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18383
		    free(allocatedBits);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18384
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
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
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18388
	}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18389
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18390
	if (xIcon) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 18391
#ifndef TOPWINDOWCLASS
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18392
	    HICON oldIcon = (HICON)0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18393
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18394
# ifdef _WIN64
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18395
	    oldIcon = (HICON) GetClassLongPtr(win, GCLP_HICON);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18396
	    SetClassLongPtr(win, GCLP_HICON, (INT)xIcon);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18397
# else
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18398
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18399
	    SetClassLong(win, GCL_HICON, (DWORD)xIcon);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18400
# endif
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18401
/* It has to be checked whether this can be deleted!!!!! */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18402
	    if ( oldIcon ) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18403
		if (DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18404
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18405
		} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 18406
		    console_fprintf(stderr, "failed to delete old icon\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18407
		}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18408
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 18409
#else
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 18410
	    SendMessage(win, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)xIcon);
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 18411
	    SendMessage(win, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 18412
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18413
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18414
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18415
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18416
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18417
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18418
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18419
raiseWindow:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18420
    "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
 18421
     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
 18422
     as topmost, when it gets the focus)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18423
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18424
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18425
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18426
    if (__isExternalAddress(aWindowId)) {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18427
	HWND hWnd = _HWNDVal(aWindowId);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18428
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18429
	if (hWnd) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18430
	    CPRINTF(("raiseWindow %x\n",hWnd));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18431
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18432
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18433
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18434
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18435
	}
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18436
    }
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18437
%}
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18438
!
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18439
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18440
raiseWindowToTop:aWindowId
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18441
    "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
 18442
     Q: is this a windows-specific thing ?"
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18443
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18444
%{  /* NOCONTEXT */
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18445
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18446
    if (__isExternalAddress(aWindowId)) {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18447
	HWND hWnd = _HWNDVal(aWindowId);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18448
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18449
	if (hWnd) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18450
	    CPRINTF(("raiseWindow %x\n",hWnd));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18451
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18452
	    SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18453
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18454
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18455
			SWP_NOMOVE | SWP_NOSIZE);
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
	    SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18458
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18459
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18460
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18461
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18462
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18463
			/* SWP_NOOWNERZORDER | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18464
			/* SWP_NOSENDCHANGING | SWP_NOACTIVATE | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18465
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18466
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18467
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18468
			/* SWP_NOOWNERZORDER | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18469
			/* SWP_NOSENDCHANGING | SWP_NOACTIVATE | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18470
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18471
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18472
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18473
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18474
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18475
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18476
raiseWindowToTopMost:aWindowId
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18477
    "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
 18478
     Q: is this a windows-specific thing ?"
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18479
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18480
%{  /* NOCONTEXT */
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18481
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18482
    if (__isExternalAddress(aWindowId)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18483
	HWND hWnd = _HWNDVal(aWindowId);
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18484
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18485
	if (hWnd) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18486
	    CPRINTF(("raiseWindow %x\n",hWnd));
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18487
	    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
 18488
	}
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
%}
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18491
!
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18492
4441
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18493
reparentWindow:windowId to:newParentWindowId
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18494
    "change a windows parent (an optional interface)"
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18495
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 18496
%{  /* NOCONTEXT */
4441
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18497
    if (__isExternalAddress(windowId)
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18498
     && __isExternalAddress(newParentWindowId)) {
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18499
	HWND hWnd = _HWNDVal(windowId);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18500
	HWND hWndNewParent = _HWNDVal(newParentWindowId);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18501
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18502
	SetParent(hWnd, hWndNewParent);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18503
	RETURN ( true );
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18504
    }
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18505
%}.
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18506
    self primitiveFailed
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18507
!
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18508
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18509
resizeWindow:aWindowId width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18510
    "resize a window"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18511
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18512
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18513
    RECT rec;
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18514
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18515
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18516
     && __bothSmallInteger(w, h)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18517
	HWND hWnd = _HWNDVal(aWindowId);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18518
	int bw;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18519
2593
1d2dad16f32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
 18520
	if (hWnd) {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18521
	    bw = GetWindow_bw(hWnd);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18522
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 18523
	    rec.left = 0;  /* only needed to have a valid origin in adjust */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 18524
	    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
 18525
	    rec.right = __intVal(w) - bw - bw;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18526
	    rec.bottom = __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18527
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18528
	    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
 18529
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18530
	    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
 18531
	    SetWindowPos(hWnd, (HWND)0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18532
			 0, 0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18533
			 rec.right - rec.left, rec.bottom - rec.top,
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18534
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18535
			 SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18536
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18537
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18538
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18539
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18540
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18541
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18542
sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18543
    "send a button message to a window by id (handle)"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18544
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18545
    |wParam lParam result|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18546
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18547
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18548
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18549
    wParam := 0.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18550
    lParam := (aPoint x) + (aPoint y bitShift:16).
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18551
    result := self primSendMessage:aWindowId message:messageType wParam:wParam lParam:lParam.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18552
    ^ result
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18553
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
     |v b externalAddress handle|
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
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18558
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18559
     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
 18560
     v openAndWait.
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
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18563
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18564
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18565
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18566
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18567
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18568
!
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
sendButtonPress:button at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18571
    "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
 18572
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18573
    |messageType|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18574
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18575
    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
 18576
    messageType := #(   16r0201 "WM_LBUTTONDOWN"
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18577
			16r0207 "WM_MBUTTONDOWN"
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18578
			16r0204 "WM_RBUTTONDOWN"  ) at:button.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18579
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18580
    self sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18581
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18582
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18583
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18584
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18585
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18586
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18587
     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
 18588
     v openAndWait.
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
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18591
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18592
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18593
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18594
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18595
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18596
!
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
sendButtonRelease:button at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18599
    "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
 18600
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18601
    |messageType|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18602
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18603
    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
 18604
    messageType := #(   16r0202 "WM_LBUTTONUP"
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18605
			16r0208 "WM_MBUTTONUP"
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18606
			16r0205 "WM_RBUTTONUP"  ) at:button.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18607
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18608
    self sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18609
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18610
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18611
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18612
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18613
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18614
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18615
     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
 18616
     v openAndWait.
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
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18619
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18620
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18621
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18622
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18623
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18624
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18625
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18626
sendCopyData: aByteArrayOrString toWindowId: aWindowId
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18627
    "send copy-paste data to a window by id (handle)"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18628
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18629
    |externalBytes messageType lParam copyDataStruct|
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18630
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18631
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18632
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18633
    messageType := 74 "WM_COPYDATA".
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18634
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18635
    externalBytes := aByteArrayOrString asExternalBytesUnprotected.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18636
    copyDataStruct := CopyDataStructStructure new.
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 18637
    copyDataStruct
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 18638
	cbData:externalBytes size;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 18639
	lpData:externalBytes address.
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18640
    lParam := copyDataStruct asExternalBytesUnprotected.
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18641
    ^ self primSendMessage:aWindowId message:messageType wParam:nil lParam:lParam.
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18642
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18643
    "
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18644
     |handle|
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18645
     handle := Display primFindWindowA: nil windowName: 'expecco'.
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18646
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18647
     Display sendCopyData: 'openPath: bla' toWindowId: handle.
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18648
     Display setForegroundWindow: handle.
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18649
    "
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18650
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18651
    "
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18652
     |bytes handle|
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18653
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18654
     bytes := 'c:\pipo.net' asByteArray.
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18655
     handle := Display primFindWindowA: nil windowName: 'ST/X Launcher'.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18656
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18657
     Display setForegroundWindow: handle.
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18658
     Display sendCopyData: bytes toWindowId: handle.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18659
    "
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18660
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18661
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18662
setBackingStore:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18663
    "turn on/off backing-store for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18664
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18665
    "/ 'WinWorkstation [info]: setBackingStore:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18666
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18667
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18668
setBitGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18669
    "set bit gravity for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18670
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18671
    "/ 'WinWorkstation [info]: setBitGravity:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18672
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18673
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18674
setCursor:aCursorId in:aWindowId
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18675
    "define a cursor for a window"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18676
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18677
%{  /* NOCONTEXT */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18678
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18679
    HCURSOR newCursor;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18680
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18681
    if (ISCONNECTED
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18682
     && __isExternalAddress(aWindowId)
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18683
     && __isExternalAddress(aCursorId)) {
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18684
	HWND win = _HWNDVal(aWindowId);
5521
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18685
//        POINT p;
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18686
//        GUITHREADINFO info;
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18687
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18688
	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
 18689
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18690
	/*
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18691
	 * 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
 18692
	 * 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
 18693
	 * 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
 18694
	 * 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
 18695
	 */
5521
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18696
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18697
// forget about the GetGUIThreadInfo stuff (although it works) - __currentPointerView is easier
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18698
//        info.cbSize = sizeof(info);
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18699
//        if (GetGUIThreadInfo(0, &info) == 0) {
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18700
//            info.hwndCapture = 0;               // set to defined value on failure
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18701
//        }
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18702
//        if (info.hwndCapture == win
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18703
//            || (GetCursorPos(&p), WindowFromPoint(p) == win)) {
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18704
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18705
	if (win == __currentPointerView) {
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18706
#if defined(SET_CURSOR_IN_WINTHREAD)
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 18707
	    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
 18708
#else
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18709
	    SetCursor(_HCURSORVal(aCursorId));
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18710
#endif
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18711
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18712
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18713
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18714
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18715
4439
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18716
setForegroundWindow2:aWindowId
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18717
    "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
 18718
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18719
%{  /* NOCONTEXT */
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18720
    if (__isExternalAddress(aWindowId)) {
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18721
	HWND win = _HWNDVal(aWindowId);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18722
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18723
	if (win) {
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18724
	    ShowWindow(win, SW_SHOW);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18725
	    SetForegroundWindow(win);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18726
	    BringWindowToTop(win);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18727
	}
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18728
	RETURN ( self );
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18729
    }
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
!
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18732
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18733
setForegroundWindow:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18734
    "make a window the foreground window.
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18735
     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
 18736
     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
 18737
     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
 18738
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18739
    <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
 18740
!
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18741
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18742
setIconName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18743
    "define a windows iconname"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18744
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18745
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18746
#if 0
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18747
    if (__isExternalAddress(aWindowId)
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 18748
     && (__isStringLike(aString))) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18749
	HWND win = _HWNDVal(aWindowId);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18750
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18751
	SetWindowText(win, __stringVal(aString));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18752
	RETURN (self);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18753
    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18754
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18755
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18756
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18757
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18758
setParentWindowIdOf:aChildWindowId to:newParentWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18759
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18760
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18761
    if (__isExternalAddress(aChildWindowId)
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18762
     && __isExternalAddress(newParentWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18763
	HWND wChild = _HWNDVal(aChildWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18764
	HWND wNewParent = _HWNDVal(newParentWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18765
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18766
	if (wChild && wNewParent) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18767
	    SetParent(wChild, wNewParent);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18768
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18769
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18770
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18771
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18772
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18773
setSaveUnder:yesOrNo in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18774
    "turn on/off save-under for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18775
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18776
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18777
    if (yesOrNo != false) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18778
	DPRINTF(("WinWorkstation [info]: setSaveUnder:in: not (yet) implemented\n"));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18779
    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18780
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18781
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18782
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18783
setTransient:aWindowId for:aMainWindowId
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18784
    "set aWindowId to be a transient of aMainWindow.
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18785
     This will make the transient window to be iconified/deiconified
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18786
     together with the mainWindow.
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18787
     Typically, this is set for modal dialogs."
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18788
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18789
%{  /* NOCONTEXT */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18790
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18791
#ifdef NOT_YET_SUPPORTED
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18792
    if (__isExternalAddress(aWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18793
	HWND w;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18794
	HWND cw = _HWNDVal(aWindowId);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18795
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18796
	if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18797
	    w = (HWND) 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18798
	} else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18799
	    if (__isExternalAddress(aMainWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18800
		w = _HWNDVal(aMainWindowId);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18801
	    } else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18802
		goto getOutOfHere;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18803
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18804
	}
2417
1e40a40e56e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2416
diff changeset
 18805
	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
 18806
	//SetParent(cw, w);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18807
	RETURN ( self );
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18808
    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18809
 getOutOfHere: ;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18810
#else
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18811
    RETURN (self);
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18812
#endif
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18813
%}.
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18814
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18815
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18816
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18817
setWindowBackground:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18818
    "set the windows background color. This is the color with which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18819
     the view is filled whenever exposed. Do not confuse this with
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18820
     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
 18821
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18822
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18823
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18824
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18825
     && (__isSmallInteger(aColorIndex))) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18826
	HWND hWnd = _HWNDVal(aWindowId);
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18827
	int clr;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18828
	HBRUSH oldBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18829
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18830
	oldBrush = GetWindow_viewBgBrush(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18831
	if (oldBrush) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18832
	    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18833
	    _DeleteBrushIfNotInCache(oldBrush, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18834
	}
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18835
	clr = st2RGB(__intVal(aColorIndex), 0);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18836
	SetWindow_viewBgColor(hWnd, clr);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18837
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18838
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18839
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18840
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18841
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18842
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18843
setWindowBackgroundPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18844
    "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
 18845
     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
 18846
     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
 18847
     with opaque drawing.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18848
     NOTICE: due to the limitations of WIN95,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18849
	     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
 18850
	     are handled by smalltalk code in the WIN95 version."
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18851
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18852
%{
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18853
    if (__isExternalAddress(aWindowId)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18854
	HWND hWnd = _HWNDVal(aWindowId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18855
	HBITMAP pixmap;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18856
	HBRUSH oldBrush, newBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18857
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18858
	if (__isExternalAddress(aPixmapId))
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18859
	    pixmap = _HBITMAPVAL(aPixmapId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18860
	else
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18861
	    pixmap = 0;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18862
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18863
	oldBrush = GetWindow_viewBgBrush(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18864
	if (oldBrush) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18865
	    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18866
	    _DeleteBrushIfNotInCache(oldBrush, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18867
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18868
	if (pixmap) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18869
	    newBrush = CreatePatternBrush(pixmap);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 18870
	    SetWindow_viewBgBrush(hWnd, newBrush);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18871
/*
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18872
 *            SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18873
 */
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18874
	}
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
	RETURN (self);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18877
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18878
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18879
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18880
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18881
setWindowBorderColor:aColorIndex in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18882
    "set the windows border color.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18883
     NOTICE: borders are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18884
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18885
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18886
    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
 18887
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18888
    if (__isExternalAddress(aWindowId)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18889
     && __isSmallInteger(aColorIndex)) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18890
	HWND win = _HWNDVal(aWindowId);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18891
	int clr;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18892
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18893
	if (GetParent(win) != 0) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18894
	    clr = st2RGB(__intVal(aColorIndex), 0);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18895
	    SetWindow_bdColor(win, clr);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18896
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18897
	    {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18898
		/*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18899
		 * 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
 18900
		 * border colors ... (see UIPainter code)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18901
		 */
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18902
		RECT rect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18903
		HRGN rgn;
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
		GetWindowRect(win, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18906
		rgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 18907
		DefWindowProcW(win, WM_NCPAINT, (WPARAM)rgn, 0);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18908
		_DeleteObject(rgn, __LINE__);
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
	}
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18911
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18912
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18913
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18914
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18915
setWindowBorderPixmap:aPixmapId in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18916
    "set the windows border pattern.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18917
     NOTICE: border pixmaps are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18918
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18919
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18920
    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
 18921
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18922
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18923
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18924
setWindowBorderWidth:aNumber in:aWindowId
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 18925
    "set a window's border width.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18926
     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
 18927
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18928
%{  /* NOCONTEXT */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18929
    int bw = (aNumber == __MKSMALLINT(0)) ? 0 : 1;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18930
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18931
    if (__isExternalAddress(aWindowId)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18932
	HWND win = _HWNDVal(aWindowId);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18933
	int gwl;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18934
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18935
	gwl = GetWindowLong(win, GWL_STYLE);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18936
	if (gwl & WS_CHILD) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18937
	    SetWindow_bw(win, bw);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18938
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18939
	    if (bw) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18940
		gwl |= WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18941
	    } else {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18942
		gwl &= ~WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18943
	    }
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18944
	    SetWindowLong(win, GWL_STYLE, gwl);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18945
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18946
	    /*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18947
	     * 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
 18948
	     * border colors ... (see UIPainter code)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18949
	     */
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 18950
#if 0
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18951
	    PostMessage(win, WM_NCPAINT, 0, 0);
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 18952
#endif
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
		RECT rect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18955
		HRGN rgn;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18956
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18957
		GetWindowRect(win, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18958
		rgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 18959
		DefWindowProcW(win, WM_NCPAINT, (WPARAM)rgn, 0);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18960
		_DeleteObject(rgn, __LINE__);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18961
	    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18962
	}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18963
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18964
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18965
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18966
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18967
setWindowClass:wClass name:wName in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18968
    "define class and name of a window.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18969
     This may be used by the window manager to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18970
     select client specific resources."
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18971
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18972
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18973
    DPRINTF(("WinWorkstation [info]: setWindowClass:name:in: not (yet) implemented\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18974
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18975
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18976
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18977
setWindowGravity:how in:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18978
    "set the window gravity - this makes the view to move
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18979
     automatically and can avoid redraws (if used properly)"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18980
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18981
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18982
    int gr = GRAVITY_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18983
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18984
    if (__isExternalAddress(aWindowId)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18985
	HWND hWnd = _HWNDVal(aWindowId);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18986
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18987
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18988
	if (how == @symbol(South)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18989
	    gr = GRAVITY_S;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18990
	} else if (how == @symbol(SouthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18991
	    gr = GRAVITY_SW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18992
	} else if (how == @symbol(SouthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18993
	    gr = GRAVITY_SE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18994
	} else if (how == @symbol(North)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18995
	    gr = GRAVITY_N;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18996
	} else if (how == @symbol(NorthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18997
	    gr = GRAVITY_NW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18998
	} else if (how == @symbol(NorthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18999
	    gr = GRAVITY_NE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19000
	} else if (how == @symbol(East)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19001
	    gr = GRAVITY_E;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19002
	} else if (how == @symbol(West)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19003
	    gr = GRAVITY_W;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19004
	}
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 19005
	lI = GETLOCALWINDOWINFOPTR(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 19006
	if (lI) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19007
	    lI->viewGravity = gr;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19008
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19009
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 19010
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19011
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19012
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19013
setWindowIcon:aForm mask:aMaskForm in:aWindowId
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19014
    "set a windows icon & iconMask"
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19015
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19016
    |wiconId wmaskId wiconHeight wiconWidth|
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19017
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19018
    aForm notNil ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19019
	wiconId := aForm id.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19020
	wiconHeight := aForm height.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19021
	wiconWidth  := aForm width.
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19022
	aMaskForm notNil ifTrue:[
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19023
	    wmaskId := aMaskForm id
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19024
	].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19025
	self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19026
	    primSetWindowIconId:wiconId
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19027
	    maskId:wmaskId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19028
	    width:wiconWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19029
	    height:wiconHeight
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19030
	    in:aWindowId
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19031
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19032
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19033
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19034
setWindowIconWindow:aView in:aWindowId
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19035
    "define a window to be used as icon.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19036
     This is not supported with Windows (is it possible at all ?)."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19037
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19038
    'WinWorkstation [info]: setWindowIconWindow:in: not implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19039
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19040
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19041
setWindowMinExtent:minExt maxExtent:maxExt in:aWindowId
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19042
    "set a windows minimum & max extents.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19043
     nil arguments are ignored."
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19044
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19045
    |minW minH maxW maxH|
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19046
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19047
    minExt notNil ifTrue:[
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19048
	minW := minExt x.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19049
	minH := minExt y.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19050
    ].
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19051
    maxExt notNil ifTrue:[
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19052
	maxW := maxExt x.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19053
	maxH := maxExt y.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19054
    ].
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 19055
%{
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19056
    if (__isExternalAddress(aWindowId)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19057
	HWND win = _HWNDVal(aWindowId);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19058
	RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19059
	int winStyleBits;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19060
	int winExStyleBits;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19061
	localWindowInfo *lI;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19062
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19063
	if (win) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19064
	    winStyleBits = GetWindowLong(win, GWL_STYLE);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19065
	    winExStyleBits = GetWindowLong(win, GWL_EXSTYLE);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19066
	    lI = GETLOCALWINDOWINFOPTR(win);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19067
	    if (! lI) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 19068
		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
 19069
		RETURN (self);
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
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19072
	    if (__bothSmallInteger(minW, minH)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19073
		RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19074
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19075
		rec.left = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19076
		rec.top = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19077
		rec.right = __intVal(minW);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19078
		rec.bottom = __intVal(minH);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19079
#ifdef ADJUSTWINDOW
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19080
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19081
#endif
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19082
		lI->minWidth = rec.right - rec.left;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19083
		lI->minHeight = rec.bottom - rec.top;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19084
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19085
	    if (__bothSmallInteger(maxW, maxH)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19086
		RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19087
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19088
		rec.left = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19089
		rec.top = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19090
		rec.right = __intVal(maxW);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19091
		rec.bottom = __intVal(maxH);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19092
#ifdef ADJUSTWINDOW
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19093
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19094
#endif
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19095
		lI->maxWidth = rec.right - rec.left;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19096
		lI->maxHeight = rec.bottom - rec.top;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19097
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19098
	}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19099
    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19100
%}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19101
!
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19102
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19103
setWindowName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19104
    "define a windows name"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19105
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19106
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19107
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19108
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19109
	HWND win = _HWNDVal(aWindowId);
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19110
	wchar_t nameBuffer[ MAX_LABEL_SIZE ];
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19111
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 19112
	if (__isStringLike(aString)) {
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19113
	    ch2wch((char *)__stringVal(aString), nameBuffer, MAX_LABEL_SIZE);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19114
	    SetWindowTextW(win, nameBuffer);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19115
	    RETURN (self);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19116
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19117
	if (__isUnicode16String(aString)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19118
	    int l = __unicode16StringSize(aString);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19119
	    if (l >= MAX_LABEL_SIZE) l = MAX_LABEL_SIZE-1;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19120
	    memmove(nameBuffer, __unicode16StringVal(aString), l*sizeof(wchar_t));
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19121
	    nameBuffer[ l ] = 0;
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
    }
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19126
%}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19127
    "
8318
a3745ee87e94 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 8192
diff changeset
 19128
     (StandardSystemView new label:'äöü') open
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19129
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19130
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19131
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19132
setWindowShapeEllipticalX:x Y:y width:w height:h in:aWindowId
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19133
    "set the windows shape to an elliptical region"
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19134
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19135
%{
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19136
    if (__isExternalAddress(aWindowId)
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19137
     && __bothSmallInteger(x, y)
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19138
     && __bothSmallInteger(w, h)) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19139
	HWND win = _HWNDVal(aWindowId);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19140
	int left = __intVal(x);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19141
	int top = __intVal(y);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19142
	int right = left + __intVal(w);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19143
	int bottom = top + __intVal(h);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19144
	HRGN rgn;
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19145
	HDC winDC;
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19146
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19147
	rgn = CreateEllipticRgn(left, top, right, bottom);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19148
	if (rgn) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19149
	    winDC = GetDCEx(win, 0, DCX_WINDOW);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19150
	    if (winDC) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 19151
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 19152
		GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 19153
#endif
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19154
		if (SelectClipRgn(winDC, rgn) == ERROR ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 19155
		    console_fprintf(stderr, "select clipping region failed\n");
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19156
		}
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19157
		ReleaseDC(win, winDC);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19158
	    }
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19159
	    else
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 19160
		console_fprintf(stderr, "getDC failed\n");
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 19161
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 19162
	    _DeleteObject(rgn, __LINE__);
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19163
	}
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19164
	else
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 19165
	    console_fprintf(stderr, "region creation failed\n");
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19166
	RETURN ( self );
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19167
    }
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19168
%}.
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19169
    self primitiveFailed
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19170
!
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19171
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19172
topWindowIdsDo:aBlock
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19173
    |l|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19174
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19175
    l := OrderedCollection new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19176
    self primEnumWindowsInto:l.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19177
    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
 19178
	(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
 19179
	    "/ a topView
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19180
	    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
 19181
	]
5332
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
    ^ nil
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19184
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19185
    "
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19186
     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
 19187
	|nm|
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19188
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19189
	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
 19190
	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
 19191
	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
 19192
	Transcript showCR:nm.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19193
     ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19194
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19195
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19196
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19197
     |w|
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19198
     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
 19199
	|nm|
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19200
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19201
	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
 19202
	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
 19203
	(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
 19204
	    w := id.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19205
	]
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19206
     ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19207
     Display resizeWindow:w width:1024 height:1024
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19208
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19209
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19210
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19211
unmapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19212
    "make a window invisible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19213
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19214
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19215
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19216
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19217
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19218
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19219
	if (win) {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 19220
	    CPRINTF(("unmapWindow %x\n",win));
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 19221
	    SetWindow_unmapping(win, 1);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19222
	    ShowWindowAsync(win, SW_HIDE);
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
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19225
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19226
%}
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19227
!
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19228
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19229
unmapWindow:aWindowId animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19230
    "make a window invisible with some animation effect."
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19231
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19232
    self animateWindow:aWindowId show:false animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19233
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19234
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19235
windowIsIconified:aWindowId
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19236
    "return true, if some window is iconified."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19237
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19238
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19239
    if (__isExternalAddress(aWindowId)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19240
	HWND win = _HWNDVal(aWindowId);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19241
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19242
	if (win) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19243
	    if (GetWindow_iconified(win)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19244
		RETURN (true);
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
	}
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19247
    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19248
%}.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19249
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19250
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19251
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19252
!WinWorkstation methodsFor:'window stuff-native'!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19253
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19254
enableScrollBar:howSymbol in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19255
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19256
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19257
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19258
    if (__isExternalAddress(aWindowId)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19259
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19260
	int how;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19261
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19262
	if (howSymbol == @symbol(ENABLE_BOTH)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19263
	    how = ESB_ENABLE_BOTH;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19264
	} else if (howSymbol == @symbol(DISABLE_LTUP)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19265
	    how = ESB_DISABLE_LTUP;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19266
	} else if (howSymbol == @symbol(DISABLE_RTDN)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19267
	    how = ESB_DISABLE_RTDN;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19268
	} else if (howSymbol == @symbol(DISABLE_BOTH)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19269
	    how = ESB_DISABLE_BOTH;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19270
	} else {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19271
	    RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19272
	}
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19273
	NDPRINTF(("EnableScrollBar(%d)\n", how));
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19274
	EnableScrollBar(win, SB_CTL, how);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19275
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19276
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19277
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19278
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19279
!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19280
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19281
setScrollBarPageSize:sz redraw:redraw in:aWindowId
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19282
    "native scrollBar widget access"
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19283
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19284
%{
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19285
    if (__isExternalAddress(aWindowId)
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19286
     && __isSmallInteger(sz)) {
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19287
	HWND win = _HWNDVal(aWindowId);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19288
	SCROLLINFO info;
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19289
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19290
	info.cbSize = sizeof(SCROLLINFO);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19291
	info.nPage = __intVal(sz);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19292
	info.fMask = SIF_PAGE;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 19293
	NDPRINTF2(("SetScrollPage(%d)\n", __intVal(sz)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19294
	SetScrollInfo(win, SB_CTL, &info, redraw==true ? 1 : 0);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19295
	RETURN ( self );
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19296
    }
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19297
%}.
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19298
    self primitiveFailed
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19299
!
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19300
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19301
setScrollPosition:newPosition redraw:redraw in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19302
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19303
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19304
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19305
    if (__isExternalAddress(aWindowId)
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19306
     && __isSmallInteger(newPosition)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19307
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19308
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 19309
	NDPRINTF2(("SetScrollPos(%d)\n", __intVal(newPosition)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19310
	SetScrollPos(win, SB_CTL, __intVal(newPosition), redraw==true ? 1 : 0);
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19311
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19312
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19313
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19314
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19315
!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19316
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19317
setScrollRange:min to:max redraw:redraw in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19318
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19319
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19320
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19321
    if (__isExternalAddress(aWindowId)
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19322
     && __bothSmallInteger(min, max)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19323
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19324
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
 19325
	NDPRINTF2(("SetScrollRange(%d..%d)\n", __intVal(min), __intVal(max)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19326
	SetScrollRange(win, SB_CTL, __intVal(min), __intVal(max), redraw==true ? 1 : 0);
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19327
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19328
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19329
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19330
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19331
! !
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19332
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19333
!WinWorkstation::AlphaBlendParameters methodsFor:'accessing'!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19334
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19335
at:index
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19336
    ^ self instVarAt:index
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19337
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19338
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19339
blueMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19340
    ^ blueMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19341
!
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
blueMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19344
    blueMask := something.
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
greenMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19348
    ^ greenMask
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
greenMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19352
    greenMask := 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
padding
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19356
    ^ padding
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
padding:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19360
    padding := 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
redMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19364
    ^ redMask
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
redMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19368
    redMask := 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
sourceAlpha
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19372
    ^ sourceAlpha
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
sourceAlpha:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19376
    sourceAlpha := 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
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19379
!WinWorkstation::CopyDataStructStructure class methodsFor:'accessing'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19380
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19381
sizeInBytes
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19382
    ExternalAddress pointerSize == 8 ifTrue:[
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 19383
	^ 24.
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19384
    ].
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19385
    ^ 12
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19386
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19387
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19388
!WinWorkstation::CopyDataStructStructure class methodsFor:'instance creation'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19389
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19390
new
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19391
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19392
    ^super new: self sizeInBytes
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19393
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19394
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19395
!WinWorkstation::CopyDataStructStructure methodsFor:'accessing'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19396
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19397
cbData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19398
    ExternalAddress pointerSize == 8 ifTrue:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19399
	^ self unsignedInt32At: 8 + 1.
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19400
    ].
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19401
    ^ self unsignedInt32At: 4 + 1.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19402
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19403
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19404
cbData: cbData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19405
    ExternalAddress pointerSize == 8 ifTrue:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19406
	self unsignedInt32At: 8 + 1  put: cbData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19407
    ] ifFalse:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19408
	self unsignedInt32At: 4 + 1  put: cbData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19409
    ].
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
dwData
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 unsignedInt64At: 0 + 1.
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19415
    ].
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19416
    ^ self unsignedInt32At: 0 + 1.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19417
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19418
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19419
dwData: dwData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19420
    ExternalAddress pointerSize == 8 ifTrue:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19421
	self unsignedInt64At: 0 + 1 put:dwData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19422
    ] ifFalse:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19423
	self unsignedInt32At: 0 + 1 put:dwData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19424
    ].
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
lpData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19428
    ExternalAddress pointerSize == 8 ifTrue:[
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 19429
	^ self unsignedInt64At: 16 + 1.
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19430
    ].
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19431
    ^ self unsignedInt32At: 8 + 1.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19432
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19433
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19434
lpData: lpData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19435
    ExternalAddress pointerSize == 8 ifTrue:[
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 19436
	self unsignedInt64At: 16 + 1  put: lpData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19437
    ] ifFalse:[
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 19438
	self unsignedInt32At: 8 + 1  put: lpData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19439
    ].
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19440
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19441
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19442
!WinWorkstation::MonitorInfo methodsFor:'accessing'!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19443
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19444
bounds
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19445
     "return a rectangle representing the displays bounding box of the monitor"
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19446
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19447
"/ ******* MULTI SCREEN ******
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19448
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19449
    ^ Rectangle
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19450
	left:screenX
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19451
	top:screenY
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19452
	width:workW - 1
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19453
	height:workH - 1
5615
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
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19456
isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19457
    ^ isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19458
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19459
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19460
name
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19461
    ^ name
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19462
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19463
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19464
screenHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19465
    ^ screenH
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
screenWidth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19469
    ^ screenW
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
screenX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19473
    ^ screenX
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
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 19476
screenX:screenXArg screenY:screenYArg screenWidth:screenWArg screenHeight:screenHArg
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 19477
    workX:workXArg workY:workYArg workWidth:workWArg workHeight:workHArg
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 19478
    isPrimary:isPrimaryArg name:nameArg
5329
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 := screenXArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19481
    screenY := screenYArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19482
    screenW := screenWArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19483
    screenH := screenHArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19484
    workX := workXArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19485
    workY := workYArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19486
    workW := workWArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19487
    workH := workHArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19488
    isPrimary := isPrimaryArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19489
    name := nameArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19490
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19491
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19492
screenY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19493
    ^ screenY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19494
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19495
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19496
workHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19497
    ^ workH
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
workWidth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19501
    ^ workW
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
workX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19505
    ^ workX
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
workY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19509
    ^ workY
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
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19512
!WinWorkstation::PrinterDeviceContextHandle class methodsFor:'documentation'!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19513
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19514
documentation
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19515
"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19516
    This is used as a finalization handle for printer contexts
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19517
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19518
    [see also:]
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19519
	DeviceHandle
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19520
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19521
    [author:]
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19522
	Claus Gittinger
4488
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
"
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
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19527
!WinWorkstation::PrinterDeviceContextHandle methodsFor:'finalization'!
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
finalize
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19530
    "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
 19531
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19532
    |id|
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
    (id := gcId) notNil ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19535
	gcId := nil.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19536
	device destroyPrinterDC:id.
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19537
    ]
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19538
! !
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19539
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19540
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19541
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19542
version
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 19543
    ^ '$Header$'
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 19544
!
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 19545
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 19546
version_CVS
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 19547
    ^ '$Header$'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19548
! !
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 19549
6007
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
 19550
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19551
WinWorkstation initialize!