WinWorkstation.st
author ab
Thu, 22 Nov 2012 13:38:39 +0100
changeset 5955 b93044c7d33b
parent 5943 55021742c5fd
child 5958 22d01fc6a7ff
permissions -rw-r--r--
Add support of Hotkeys. Add WM_HOTKEY to dispatchThread (handled like WM_SYSKEYUP/DOWN) and add method #registerHotKeyWithId:modifiers:virtualKeyCode: to allow hot key registration
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     1
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     2
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     3
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     5
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     6
 only in accordance with the terms of that license and with the
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     9
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    10
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    11
"
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    12
"{ Package: 'stx:libview' }"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    13
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    14
DeviceWorkstation subclass:#WinWorkstation
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    15
	instanceVariableNames:'blackpixel whitepixel listOfFonts rootWin rootDC buttonsPressed
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
    16
		eventTrace eventBuffer lastClipboardSequenceNumber'
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    17
	classVariableNames:'BeepDuration NativeDialogs NativeFileDialogs NativeWidgets
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    18
		NativeWidgetClassTable StandardColorValues IgnoreSysColorChanges
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    19
		IgnoreFontChanges SystemColorValues CanEndSession
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    20
		VerboseNativeDialogs'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    21
	poolDictionaries:''
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    22
	category:'Interface-Graphics'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    23
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    24
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    25
Object subclass:#AlphaBlendParameters
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    26
	instanceVariableNames:'sourceAlpha padding redMask greenMask blueMask'
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    27
	classVariableNames:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    28
	poolDictionaries:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    29
	privateIn:WinWorkstation
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    30
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    31
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    32
ByteArray variableByteSubclass:#CopyDataStructStructure
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    33
	instanceVariableNames:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    34
	classVariableNames:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    35
	poolDictionaries:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    36
	privateIn:WinWorkstation
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    37
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    38
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    39
Object subclass:#MonitorInfo
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    40
	instanceVariableNames:'screenX screenY screenW screenH workX workY workW workH isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    41
		name'
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    42
	classVariableNames:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    43
	poolDictionaries:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    44
	privateIn:WinWorkstation
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    45
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    46
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    47
DeviceHandle subclass:#PrinterDeviceContextHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    48
	instanceVariableNames:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    49
	classVariableNames:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    50
	poolDictionaries:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    51
	privateIn:WinWorkstation
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    52
!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    53
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    54
!WinWorkstation primitiveDefinitions!
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    55
%{
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
    56
#define TRACE_ALL_EVENTS      /* */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
    57
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    58
#define COUNT_RESOURCES       /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    59
#define COUNT_BMP_RESOURCES   /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    60
#define DEBUG_DELETEOBJECT    /* */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    61
#define DEBUG_DC_REUSE        /* */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    62
#define xxDEBUG_COLORIZE_WM_PAINT_RECTS1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    63
#define xxDEBUG_COLORIZE_WM_PAINT_RECTS2
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
    64
#define LOCK_DEBUG
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
    65
#define xxSTARTUP_DISPATCHTHREAD_DEBUG
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    66
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    67
#define ADJUSTWINDOW
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    68
#define ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    69
#define WIN32THREADS
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    70
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
    71
/* #define DEBUGMASK            /* */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    72
#define SET_FOCUS_IN_WINTHREAD
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    73
#define SET_CURSOR_IN_WINTHREAD
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
    74
#define DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE /* */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    75
#define xxBEEP_IN_WINTHREAD    /* */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    76
#define xxKEEP_STD_CURSORS     /* not useful - those are allocated only once, in any case */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    77
#define xxHANDLE_VIEWGRAVITY   /* not yet working */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    78
#define COMPRESS_WINDOWPOSCHANGED
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    79
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
    80
#define USE_DRAW_MUTEX
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
    81
#define GDIFLUSH_WHEN_CHANGING_CLIP       /* workaround a redraw problem (with dell?) */
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
    82
#define LATE_GENERATE_EXPOSE              /* get update region from stx thread */
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    83
#define xxNO_CLEAR_FOR_WM_PAINT           /* do not fill exposed areas with bgColor */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    84
#define xxLATE_CLEAR_FOR_WM_PAINT         /* fill exposed areas with bgColor in ST/X thread (instead of in event-thread) */
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
    85
					  /* seems to be needed to avoid DC conflicts */
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    86
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    87
#if 0 /* DOES NOT WORK */
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
    88
# 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
    89
# 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
    90
# 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
    91
# 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
    92
# define CACHE_LAST_TMP_FONT             /* */
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    93
#endif
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    94
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    95
#define CACHE_PEN
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    96
#define CACHE_BRUSH
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
    97
#define CACHE_LAST_DC                   /* remember last DC in gcData */
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    98
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    99
#ifdef CACHE_PEN
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   100
# define NUM_PEN_CACHED       16        /* that many solid pens are globally remembered */
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   101
#else
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   102
# define NUM_PEN_CACHED       0
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   103
#endif
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   104
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   105
#ifdef CACHE_BRUSH
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   106
# define NUM_BRUSH_CACHED     16         /* that many brushes are globally remembered */
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   107
#else
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   108
# define NUM_BRUSH_CACHED     0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   109
#endif
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   110
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   111
#if defined(NO_CLEAR_FOR_WM_PAINT)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   112
# define WM_PAINT_CLEAR_EARLY       0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   113
# define WM_PAINT_CLEAR_LATE        0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   114
#else
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
   115
# if defined(LATE_CLEAR_FOR_WM_PAINT)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   116
#  define WM_PAINT_CLEAR_EARLY       0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   117
#  define WM_PAINT_CLEAR_LATE        1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   118
# else
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   119
#  define WM_PAINT_CLEAR_EARLY       1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   120
#  define WM_PAINT_CLEAR_LATE        0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   121
# endif
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   122
#endif
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   123
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   124
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   125
#define INT WIN_INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   126
#undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   127
#define Array WIN_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   128
#undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   129
#define Number WIN_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   130
#undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   131
#define Method WIN_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   132
#undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   133
#define Point WIN_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   134
#undef Rectangle
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   135
/* #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
   136
#undef True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   137
#define True WIN_True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   138
#undef False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   139
#define False WIN_False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   140
#undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   141
#define Block WIN_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   142
#undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   143
#define Context WIN_Context
2766
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   144
#undef Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   145
#define Date WIN_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   146
#undef Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   147
#define Time WIN_Time
3119
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   148
#undef Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   149
#define Delay WIN_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   150
#undef Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   151
#define Signal WIN_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   152
#undef Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   153
#define Set WIN_Set
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   154
#undef Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   155
#define Process WIN_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   156
#undef Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   157
#define Processor WIN_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   158
#undef Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   159
#define Message WIN_Message
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   160
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
   161
#include <stdio.h>
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   162
#include <errno.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   163
/* #include <malloc.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   164
/* #include <math.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   165
/* #include <string.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   166
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   167
/*#include <stdarg.h>   */
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
   168
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   169
#ifdef __BORLANDC__
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   170
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   171
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   172
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   173
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   174
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   175
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   176
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   177
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   178
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   179
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   180
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   181
# define WIN32_LEAN_AND_MEAN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   182
# include <windows.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   183
# include <shellapi.h>
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   184
# include <sys\timeb.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   185
# include <dir.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   186
#else
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   187
# define _USERENTRY /**/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   188
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   189
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   190
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   191
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   192
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   193
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   194
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   195
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   196
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   197
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   198
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   199
# define WIN32_LEAN_AND_MEAN
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   200
# define _WIN32_WINNT 0x0500    /* need this to get certain defines from winuser.h (WM_NCXBUTTONDOWN) */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   201
# include <windows.h>
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   202
# include <shellapi.h>
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   203
# include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   204
#endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   205
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   206
#ifndef MAXPATH
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   207
# 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
   208
#endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   209
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   210
#include <commdlg.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   211
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   212
#include <process.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   213
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   214
#ifdef __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   215
# undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   216
# define Array __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   217
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   218
#ifdef __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   219
# undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   220
# define Number __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   221
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   222
#ifdef __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   223
# undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   224
# define Method __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   225
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   226
#ifdef __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   227
# undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   228
# define Point __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   229
#endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   230
#ifdef __DEF_Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   231
# undef Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   232
# define Rectangle __DEF_Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   233
#else
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   234
# undef Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   235
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   236
#ifdef __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   237
# undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   238
# define Block __DEF_Block
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_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   241
# undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   242
# define Context __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   243
#endif
2766
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   244
#ifdef __DEF_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   245
# undef Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   246
# define Date __DEF_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   247
#endif
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   248
#ifdef __DEF_Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   249
# undef Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   250
# define Time __DEF_Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   251
#endif
3119
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   252
# ifdef __DEF_Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   253
#  undef Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   254
#  define Set __DEF_Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   255
# endif
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   256
# ifdef __DEF_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   257
#  undef Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   258
#  define Signal __DEF_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   259
# endif
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   260
# ifdef __DEF_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   261
#  undef Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   262
#  define Delay __DEF_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   263
# endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   264
# ifdef __DEF_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   265
#  undef Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   266
#  define Process __DEF_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   267
# endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   268
# ifdef __DEF_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   269
#  undef Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   270
#  define Processor __DEF_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   271
# endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   272
# ifdef __DEF_Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   273
#  undef Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   274
#  define Message __DEF_Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   275
# endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   276
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   277
#if 0 /* does not work, anyway */
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   278
#ifndef WM_UNICHAR
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   279
# define WM_UNICHAR                              0x0109
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   280
#endif
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   281
#ifndef UNICODE_NOCHAR
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   282
# define UNICODE_NOCHAR                          0xFFFF
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   283
#endif
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   284
#endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   285
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   286
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   287
#define INT int
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   288
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   289
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   290
 * some defines - tired of typing ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   291
 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   292
#define _HANDLEVal(o)        (HANDLE)(__MKCP(o))
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   293
#define _HBITMAPVAL(o)       (HBITMAP)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   294
#define _HWNDVal(o)          (HWND)(__MKCP(o))
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   295
#define _HDCVal(o)           (HDC)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   296
#define _HPALETTEVal(o)      (HPALETTE)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   297
#define _HCURSORVal(o)       (HCURSOR)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   298
#define _HGDIOBJVal(o)       (HGDIOBJ)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   299
#define _LOGPALETTEVal(o)    (LOGPALETTE *)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   300
#define _COLORREFVal(o)      (COLORREF)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   301
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   302
#define _GCDATA(o)           ((struct gcData *)(__MKCP(o)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   303
3498
890cfcba79a5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3497
diff changeset
   304
#define WIDECHAR unsigned short
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
   305
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   306
#ifdef LATER
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   307
  /* 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
   308
   * 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
   309
   * 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
   310
   */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   311
# define __rootDC             (HDC)(__MKCP(__INST(rootDC)))
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   312
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   313
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   314
#define ISCONNECTED         1
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   315
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   316
struct gcData {
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   317
    union {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   318
	HDC         __hDC;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   319
	struct gcData *__nextFree;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   320
    } u;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   321
    HWND        hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   322
    HBITMAP     hBitmap;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   323
    HBITMAP     save_hBitmap;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   324
    HBITMAP     hMask;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   325
    short       clipX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   326
    short       clipY;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   327
    short       clipW;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   328
    short       clipH;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   329
    char        clipping;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   330
    char        clipByChildren;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   331
    char        bkMode;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   332
    char        bitmapColorBitCount;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   333
    short       maskOrgX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   334
    short       maskOrgY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   335
    short       lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   336
    short       fontAscent;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   337
    int         lStyle;   /* is lineStyle | joinStyle | capStyle */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   338
    int         rop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   339
    int         bitbltrop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   340
    COLORREF    fgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   341
    COLORREF    bgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   342
    HFONT       hFont;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   343
    HFONT       save_hFont;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   344
    HPEN        hPen;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   345
    HPEN        save_hPen;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   346
    HBRUSH      hBrush;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   347
    HBRUSH      save_hBrush;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   348
    char        doNotCacheOrRelease;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   349
    char        reserve1;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   350
    char        reserve2;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   351
    char        reserve3;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   352
    char        reserve4;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   353
    int         reserve5;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   354
};
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   355
#define _hDC u.__hDC
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   356
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   357
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   358
 * some synthetic values
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   359
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   360
/*****************************************************************
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   361
 * EVENT DEFINITIONS
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   362
 *****************************************************************/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   363
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   364
/* 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
   365
   to Grab requests.  Not to be confused with event names.  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   366
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   367
#define NoEventMask                     0L
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   368
#define KeyPressMask                    (1L<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   369
#define KeyReleaseMask                  (1L<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   370
#define ButtonPressMask                 (1L<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   371
#define ButtonReleaseMask               (1L<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   372
#define EnterWindowMask                 (1L<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   373
#define LeaveWindowMask                 (1L<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   374
#define PointerMotionMask               (1L<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   375
#define PointerMotionHintMask           (1L<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   376
#define Button1MotionMask               (1L<<8)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   377
#define Button2MotionMask               (1L<<9)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   378
#define Button3MotionMask               (1L<<10)
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   379
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   380
# define Button4MotionMask               (1L<<11)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   381
# define Button5MotionMask               (1L<<12)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   382
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   383
#define ButtonMotionMask                (1L<<13)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   384
#define KeymapStateMask                 (1L<<14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   385
#define ExposureMask                    (1L<<15)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   386
#define VisibilityChangeMask            (1L<<16)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   387
#define StructureNotifyMask             (1L<<17)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   388
#define ResizeRedirectMask              (1L<<18)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   389
#define SubstructureNotifyMask          (1L<<19)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   390
#define SubstructureRedirectMask        (1L<<20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   391
#define FocusChangeMask                 (1L<<21)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   392
#define PropertyChangeMask              (1L<<22)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   393
#define ColormapChangeMask              (1L<<23)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   394
#define OwnerGrabButtonMask             (1L<<24)
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
/* 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
   397
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
   398
are reserved in the protocol for errors and replies. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   399
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   400
#define KeyPress                2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   401
#define KeyRelease              3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   402
#define ButtonPress             4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   403
#define ButtonRelease           5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   404
#define MotionNotify            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   405
#define EnterNotify             7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   406
#define LeaveNotify             8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   407
#define FocusIn                 9
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   408
#define FocusOut                10
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   409
#define KeymapNotify            11
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   410
#define Expose                  12
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   411
#define GraphicsExpose          13
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   412
#define NoExpose                14
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   413
#define VisibilityNotify        15
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   414
#define CreateNotify            16
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   415
#define DestroyNotify           17
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   416
#define UnmapNotify             18
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   417
#define MapNotify               19
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   418
#define MapRequest              20
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   419
#define ReparentNotify          21
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   420
#define ConfigureNotify         22
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   421
#define ConfigureRequest        23
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   422
#define GravityNotify           24
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   423
#define ResizeRequest           25
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   424
#define CirculateNotify         26
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   425
#define CirculateRequest        27
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   426
#define PropertyNotify          28
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   427
#define SelectionClear          29
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   428
#define SelectionRequest        30
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   429
#define SelectionNotify         31
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   430
#define ColormapNotify          32
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   431
#define ClientMessage           33
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   432
#define MappingNotify           34
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   433
#define LASTEvent               35      /* must be bigger than any event # */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   434
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   435
/* 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
   436
   state in various key-, mouse-, and button-related events. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   437
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   438
/* modifier names.  Used to build a SetModifierMapping request or
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   439
   to read a GetModifierMapping request.  These correspond to the
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   440
   masks defined above. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   441
#define ShiftMapIndex           0
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   442
#define LockMapIndex            1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   443
#define ControlMapIndex         2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   444
#define Mod1MapIndex            3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   445
#define Mod2MapIndex            4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   446
#define Mod3MapIndex            5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   447
#define Mod4MapIndex            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   448
#define Mod5MapIndex            7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   449
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   450
#define ShiftMask               (1<<ShiftMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   451
#define LockMask                (1<<LockMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   452
#define ControlMask             (1<<ControlMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   453
#define Mod1Mask                (1<<Mod1MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   454
#define Mod2Mask                (1<<Mod2MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   455
#define Mod3Mask                (1<<Mod3MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   456
#define Mod4Mask                (1<<Mod4MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   457
#define Mod5Mask                (1<<Mod5MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   458
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   459
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   460
/* 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
   461
   with button names below. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   462
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   463
#define Button1Mask            Button1MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   464
#define Button2Mask            Button2MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   465
#define Button3Mask            Button3MotionMask
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   466
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   467
# define Button4Mask            Button4MotionMask
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   468
# define Button5Mask            Button5MotionMask
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   469
#endif
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   470
#define AnyButtonMask           (Button1Mask|Button2Mask|Button3Mask)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   471
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   472
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   473
# define AnyModifier             (1<<15)  /* used in GrabButton, GrabKey */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   474
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   475
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   476
/* 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
   477
   and ButtonRelease events.  Not to be confused with button masks above.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   478
   Note that 0 is already defined above as "AnyButton".  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   479
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   480
#define Button1                 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   481
#define Button2                 2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   482
#define Button3                 3
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   483
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   484
# define Button4                 4
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   485
# define Button5                 5
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   486
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   487
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   488
#define CAPTURE_NONE     0
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   489
#define CAPTURE_IMPLICIT 7
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   490
#define CAPTURE_EXPLICIT 8
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   491
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   492
#define BK_UNDEF         0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   493
#define BK_TRANSPARENT   1
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   494
#define BK_OPAQUE        2
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   495
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   496
#define GRAVITY_NONE        0
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   497
#define GRAVITY_S           1
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   498
#define GRAVITY_SW          2
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   499
#define GRAVITY_SE          3
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   500
#define GRAVITY_N           4
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   501
#define GRAVITY_NW          5
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   502
#define GRAVITY_NE          6
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   503
#define GRAVITY_E           7
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   504
#define GRAVITY_W           8
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   505
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   506
#if 0
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   507
# define ControlMask            8
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   508
# define ShiftMask              16
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   509
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   510
#define LeftAltMask            Mod1Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   511
#define RightAltMask           Mod2Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   512
#define TRANSLATED_KEY         Mod5Mask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   513
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   514
#define WIN32PADDING 32
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   515
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   516
/*
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   517
 * synthetic events
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   518
 */
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   519
#define __WM_MOUSEENTER        0x10001
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   520
#define __WM_MOUSELEAVE        0x10002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   521
#define __WM_GEXPOSE           0x10003
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   522
#define __WM_NOGEXPOSE         0x10004
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   523
#define __WM_ICONIFIED         0x10005
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
   524
#define __WM_PAINT             0x10006
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   525
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   526
static int AltMask = RightAltMask;
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   527
static int MetaMask = LeftAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   528
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   529
#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
   530
#define BlackPixel     RGB(0, 0, 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   531
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   532
/* #undef DEBUG /* */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   533
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   534
#ifdef DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   535
# define PRINTF(x)              { console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   536
# define CPRINTF(x)             { if (__debug__ > 1) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   537
# define RESPRINTF(x)           /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   538
# define RES1PRINTF(x)          /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   539
# define RES_BMP_PRINTF(x)      /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   540
# define TH_DPRINTF(x)          /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   541
# define DPRINTF(x)             { if (__debug__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   542
# define NDPRINTF(x)            { if (__debugNative__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   543
# define NDPRINTF2(x)           { if (__debugNative__ > 1) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   544
# define DDPRINTF(x)            { if (__debug__ > 1) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   545
# define BMDPRINTF(x)           { if (__debug__ > 1) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   546
# define EVENT_PRINTF(x)        { if (__debug__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   547
# define EVENT_PRINTF2(x)       { if (__debug__ > 1) console_printf x;}
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   548
# define EVENT_PRINTF3(x)       /* */
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   549
# define DPRINTFIF(flag, x)                 { if (flag) console_printf x;}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   550
# define EVENT_PRINTFIF(flag, x)            { if (flag && __debug__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   551
# 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
   552
# 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
   553
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   554
# define PRINTF(x)              /* */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   555
# define CPRINTF(x)             /* */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   556
# define RES_BMP_PRINTF(x)      /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   557
# define RESPRINTF(x)           /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   558
# define RES1PRINTF(x)          /* */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   559
# define TH_DPRINTF(x)          /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   560
# define DPRINTF(x)             /* */
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   561
# define NDPRINTF(x)            /* */
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
   562
# define NDPRINTF2(x)           /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   563
# define DDPRINTF(x)            /* */
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
   564
# define BMDPRINTF(x)           /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   565
# define EVENT_PRINTF(x)        /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   566
# define EVENT_PRINTF2(x)       /* */
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   567
# define EVENT_PRINTF3(x)       /* */
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   568
# define DPRINTFIF(flag, x)             /* */
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   569
# define EVENT_PRINTFIF(flag, x)        /* */
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   570
# define UNHANDLED_EVENT_PRINTF(x)      /* */
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   571
# define UNHANDLED_EVENT_PRINTFIF(flag, x)    /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   572
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   573
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
   574
/* # define EVENT_PRINTF(x)        { printf x;} */
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
   575
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   576
#define INFOFPRINTF(__x__)                 \
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   577
    if (@global(InfoPrinting) == true) { \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   578
	console_fprintf __x__;           \
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   579
    }
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   580
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   581
#define DEBUGFPRINTF(__x__)                 \
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   582
    if (@global(InfoPrinting) == true) { \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   583
	console_fprintf __x__;           \
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   584
    }
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   585
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   586
#define BR_SOLID       0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   587
#define BR_PATTERN     1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   588
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   589
#define LINE_SOLID     0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   590
#define LINE_DASH      1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   591
#define LINE_DDASH     2
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   592
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   593
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   594
# define _C_ARROW       1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   595
# define _C_CROSS       2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   596
# define _C_IBEAM       3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   597
# define _C_ICON        4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   598
# define _C_NO          5
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   599
# define _C_SIZE        6
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   600
# define _C_SIZEALL     7
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   601
# define _C_SIZENESW    8
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   602
# define _C_SIZENS      9
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   603
# define _C_SIZENWSE    10
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   604
# define _C_UPARROW     11
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   605
# define _C_WAIT        12
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   606
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   607
 static HCURSOR H_C_ARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   608
 static HCURSOR H_C_CROSS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   609
 static HCURSOR H_C_IBEAM = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   610
 static HCURSOR H_C_ICON = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   611
 static HCURSOR H_C_NO = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   612
 static HCURSOR H_C_SIZE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   613
 static HCURSOR H_C_SIZEALL = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   614
 static HCURSOR H_C_SIZENESW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   615
 static HCURSOR H_C_SIZENS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   616
 static HCURSOR H_C_SIZENWSE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   617
 static HCURSOR H_C_UPARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   618
 static HCURSOR H_C_WAIT = (HCURSOR)0;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
   619
 static HCURSOR H_C_APPSTARTING = (HCURSOR)0;
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   620
#endif /* KEEP_STD_CURSORS */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   621
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   622
#ifdef EXIT_WITH_3_CTRL_Cs
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   623
static int ctrl_c_count = 0;            /* CTRL-C count */
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   624
#endif
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   625
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   626
static int escape_count = 0;            /* ESCAPE count */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   627
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   628
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   629
static int evRootX, evRootY;
4476
4ba4a3ac09bc fix: double click in popup windows (affects ExtendedComboBox)
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
   630
static int multiClickCount = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   631
static UINT lastMSGTime;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   632
static UINT lastMouseWheelTime = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   633
static int lastClickX, lastClickY;
3584
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
   634
static int lastMotionX = -9999, lastMotionY = -9999;
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
   635
static HWND lastMotionWnd = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   636
static int deltaDoubleClickX = -999;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   637
static int deltaDoubleClickY = -999;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   638
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
   639
static OBJ lastButton = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   640
static int inSizeMove = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   641
static int inSize = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   642
static int inMove = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   643
static HWND needDelayedMouseLeaveWindow = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   644
static HWND needDelayedMouseEnterWindow = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   645
static int delayedMouseEnterX, delayedMouseEnterY;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   646
static int destroyWin;
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   647
static HDC   __tmpDC;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   648
#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
   649
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
   650
#endif
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   651
static int __logPixelSY;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   652
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   653
static int __isWinXP = 0;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   654
static int __isWin2k = 0;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   655
static int __isWinVista = 0;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   656
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   657
#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
   658
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
   659
static int            lastGcOwnerThreadID = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   660
static HWND           lastGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   661
static HBITMAP        lastGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   662
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   663
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   664
#ifndef __rootDC
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   665
 static HDC __rootDC;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   666
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   667
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   668
#ifdef CACHE_PEN
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   669
static struct __penCache {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   670
    HPEN            pen;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
   671
    unsigned int    clr;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   672
} __penCache[NUM_PEN_CACHED];
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   673
#endif
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   674
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   675
#ifdef CACHE_BRUSH
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   676
static struct __brushCache {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   677
    HBRUSH          brush;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
   678
    unsigned int    clr;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   679
} __brushCache[NUM_BRUSH_CACHED];
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   680
#endif
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   681
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   682
/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   683
 * globally cached - never released
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   684
 */
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   685
static HPEN __blackPen = 0;
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   686
static HPEN __whitePen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   687
static HPEN __nullPen = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   688
static HBRUSH __blackBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   689
static HBRUSH __whiteBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   690
2620
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   691
static HPEN __bgPen = 0;
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   692
static int __bgPenColor = 0;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   693
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   694
#define WM_THREAD_CREATEWINDOW   (WM_USER + 0x101)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   695
#define WM_THREAD_DESTROYWINDOW  (WM_USER + 0x102)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   696
#define WM_THREAD_SETFOCUS       (WM_USER + 0x103)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   697
#define WM_THREAD_SETCAPTURE     (WM_USER + 0x104)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   698
#define WM_THREAD_SETCURSOR      (WM_USER + 0x105)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   699
#define WM_THREAD_BEEP           (WM_USER + 0x106)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   700
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   701
#define WM_TRAY_MESSAGE          (WM_USER + 0x200)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   702
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   703
#define hasEventQueued() (eventQueueHead != NULL)
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
   704
#define EVENT_THREAD_STACKSIZE  (4096*10)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   705
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   706
typedef int (*intf)(int);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   707
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   708
/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   709
 * 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
   710
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   711
#define LI_TOPWIN       0x0001
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   712
#define LI_INPUTWIN     0x0002
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
   713
#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
   714
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   715
typedef struct {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   716
	HCURSOR         hCursor;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   717
	HBRUSH          viewBgBrush;  /* if that is nil, it has a solid bg color */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   718
	COLORREF        viewBgColor;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   719
	int             eventMask;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   720
	short           flag;         /* LI_ - flags bits */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   721
	short           minWidth;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   722
	short           maxWidth;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   723
	short           minHeight;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   724
	short           maxHeight;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   725
	short           bw;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   726
	unsigned char   iconified;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   727
	unsigned char   viewGravity;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   728
	unsigned char   unmapping;
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   729
#if 0
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   730
	short           bgOffsX;      /* bg-pattern offset */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   731
	short           bgOffsY;      /* bg-pattern offset */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   732
#endif
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   733
	short           mouseX;       /* last mouseX */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   734
	short           mouseY;       /* last mouseY */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   735
	COLORREF        bdColor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   736
} localWindowInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   737
typedef localWindowInfo *plocalWindowInfo;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   738
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   739
typedef struct createWindowInfo {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   740
	localWindowInfo *localWindowInfo;  /* in param */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   741
	HANDLE          newWinHandle;      /* out param */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   742
	wchar_t         *windowName;       /* in params */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   743
	wchar_t         *className;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   744
	int             winStyleBits;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   745
	int             winStyleBitsEx;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   746
	HANDLE          parentHandle;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   747
	int             x;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   748
	int             y;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   749
	int             dx;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   750
	int             dy;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   751
	HANDLE          hCreateEvent;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   752
	short           infoWasRead;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   753
	unsigned short  sequenceNr;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   754
	unsigned        errCode;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   755
} createWindowInfo;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   756
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   757
#define INVALIDATED_CWI 0xFFFF             /* seqNr for invalidated CWI */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   758
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   759
static createWindowInfo *pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   760
static unsigned short pendingSequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   761
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   762
#ifdef OLD
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   763
# define GWL_LOCALINFO  0
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   764
#else
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   765
# define GWL_LOCALINFO  GWL_USERDATA
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   766
#endif
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   767
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   768
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   769
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   770
#define GETLOCALWINDOWINFOPTR(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   771
	((localWindowInfo *)GetWindowLong(__hWnd__, GWL_LOCALINFO))
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   772
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   773
#define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   774
	SetWindowLong(__hWnd__, GWL_LOCALINFO , (DWORD)__ptr__)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   775
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   776
#define SetWindow_Cursor(__hWnd__, __hCurs__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   777
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   778
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   779
#define GetWindow_Cursor(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   780
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   781
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   782
#define SetWindow_viewBgColor(__hWnd__, __viewBgColor__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   783
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor = __viewBgColor__) : 0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   784
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   785
#define GetWindow_viewBgColor(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   786
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor : 0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   787
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   788
#define SetWindow_bdColor(__hWnd__, __bdColor__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   789
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bdColor = __bdColor__) : 0)
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   790
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   791
#define GetWindow_bdColor(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   792
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bdColor : 0)
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   793
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   794
#define SetWindow_iconified(__hWnd__, __iconified__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   795
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->iconified = __iconified__) : 0)
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   796
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   797
#define GetWindow_iconified(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   798
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->iconified : 0)
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   799
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   800
#define SetWindow_unmapping(__hWnd__, __unmapping__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   801
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->unmapping = __unmapping__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   802
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   803
#define GetWindow_unmapping(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   804
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->unmapping : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   805
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   806
#define SetWindow_mouseX(__hWnd__, __mouseX__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   807
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->mouseX = __mouseX__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   808
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   809
#define GetWindow_mouseX(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   810
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->mouseX : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   811
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   812
#define SetWindow_mouseY(__hWnd__, __mouseY__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   813
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->mouseY = __mouseY__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   814
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   815
#define GetWindow_mouseY(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   816
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->mouseY : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   817
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   818
#define SetWindow_mouseXY(__hWnd__, __mouseX__, __mouseY__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   819
	{ SetWindow_mouseX(__hWnd__, __mouseX__); SetWindow_mouseY(__hWnd__, __mouseY__); }
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   820
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   821
#define SetWindow_viewBgBrush(__hWnd__, __viewBgBrush__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   822
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush = __viewBgBrush__) : 0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   823
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   824
#define GetWindow_viewBgBrush(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   825
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   826
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   827
#define SetWindow_bw(__hWnd__, __bw__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   828
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bw = __bw__) : 0)
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   829
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   830
#define GetWindow_bw(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   831
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bw : 0)
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   832
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   833
#define GetWindow_paintInfoPtr(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   834
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   835
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   836
#define GetWindow_sizeInfoPtr(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   837
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->sizeInfo) : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   838
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   839
#define SetWindow_flag(__hWnd__, __flag__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   840
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   841
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   842
#define GetWindow_flag(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   843
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   844
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   845
#define GetWindow_eventMask(__hWnd__) \
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   846
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   847
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   848
struct queuedEvent {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   849
	struct queuedEvent     *ev_next;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   850
	int                     count;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   851
	int                     ev_flag;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   852
	HWND                    ev_hWnd;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   853
	UINT                    ev_message;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   854
	UINT                    ev_wParam;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   855
	int                     ev_arg1;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   856
	int                     ev_arg2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   857
	int                     ev_arg3;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   858
	int                     ev_arg4;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   859
	UINT                    ev_time;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   860
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   861
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   862
#define ev_x    ev_arg1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   863
#define ev_y    ev_arg2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   864
#define ev_w    ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   865
#define ev_h    ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   866
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   867
#define ev_keyCode   ev_wParam
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   868
#define ev_scanCode  ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   869
#define ev_modifiers ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   870
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   871
#define EV_CHUNK_CNT    10000
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   872
#define xxEV_CHUNK_CNT    1000
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   873
#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
   874
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   875
#define BITBLT_COPY             SRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   876
#define BITBLT_COPYINVERTED     NOTSRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   877
#define BITBLT_XOR              SRCINVERT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   878
#define BITBLT_AND              SRCAND
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   879
#define BITBLT_OR               SRCPAINT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   880
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   881
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   882
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   883
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   884
!WinWorkstation primitiveVariables!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   885
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   886
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   887
static int firstInstance = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   888
static char *app_name = "ST/X";
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   889
static char *app_nameRoot = "ST/X:Root";
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   890
static char *app_namePopup = "ST/X:Popup";
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   891
static char *app_nameDialog = "ST/X:Dialog";
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   892
static wchar_t wapp_name[] = { 'S','T','/','X',0 };
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   893
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
   894
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
   895
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
   896
static int __debug__ = 0;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   897
static int __debug_WM_MOUSEENTER__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   898
static int __debug_WM_MOUSELEAVE__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   899
static int __debug_WM_MOUSEMOVE__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   900
static int __debug_WM_MOUSEACTIVATE__ = 0;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   901
static int __debug_WM_CHAR__ = 0;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   902
static int __debug_WM_KEYUP__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   903
static int __debug_WM_KEYDOWN__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   904
static int __debug_WM_BUTTONUP__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   905
static int __debug_WM_BUTTONDOWN__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   906
static int __debug_WM_PAINT__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   907
static int __debug_WM_MOVING__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   908
static int __debug_WM_ERASEBKGND__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   909
static int __debug_WM_SETTEXT__ = 0;
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   910
static int __debug_WM_CTLCOLORSCROLLBAR__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   911
static int __debug_WM_GETICON__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   912
static int __debug_WM_EXPOSE__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   913
static int __debug_WM_SIZE__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   914
static int __debug_WM_WINDOWPOSCHANGING__ = 0;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
   915
static int __debug_WM_COPYDATA__ = 0;
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   916
static int __debug_WM_DROPFILES__ = 0;
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   917
static int __debug_WM_SHOWWINDOW__ = 0;
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   918
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   919
static int __debugNative__ = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   920
static int __depth;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   921
static int __realDepth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   922
static HWND __rootWin = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   923
static HWND __rootWinSpezial = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   924
#if 0
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   925
static HDESK __rootDesk;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   926
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   927
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   928
static int __activateOnClick = 1;
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   929
static int __focusFollowsMouse = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   930
static int __eatingMouseEvents = 0;
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   931
static int __ignoreButtonPressOnActivate = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   932
static int __rightButtonIsLowerWindow = 1;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   933
static int __shiftedLeftButtonIsLowerWindow = 1;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   934
static int __currentCapture = CAPTURE_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   935
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   936
static HANDLE __currentPointerView = (HANDLE)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   937
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   938
/* MessageDispatchThread */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   939
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   940
#ifndef WIN32THREADS
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   941
static HANDLE _masterThread = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   942
#endif
4443
96e956cf9acf plugin stuff now in librun
Claus Gittinger <cg@exept.de>
parents: 4441
diff changeset
   943
static DWORD _masterThreadId = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   944
static DWORD _dispatchThreadId = 0;
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
   945
static DWORD _dispatchThreadId2 = 0;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   946
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
   947
static int lockCountEvents = 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
   948
#endif
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   949
static HANDLE hEventsMutex = NULL;
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   950
static char *hEventsMutexOwner = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   951
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
   952
#ifdef USE_PAINT_MUTEX
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   953
static HANDLE hPaintMutex = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   954
# define AQUIRE_PAINT_MUTEX    { WaitForSingleObject(hPaintMutex, 100L); }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   955
# define RELEASE_PAINT_MUTEX   { ReleaseMutex(hPaintMutex);              }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   956
#else
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   957
# define AQUIRE_PAINT_MUTEX    { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   958
# define RELEASE_PAINT_MUTEX   { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   959
#endif
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   960
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   961
#ifdef USE_DRAW_MUTEX
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   962
static HANDLE hDrawMutex = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   963
# define AQUIRE_DRAW_MUTEX     { WaitForSingleObject(hDrawMutex, 100L);  }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   964
# define RELEASE_DRAW_MUTEX    { ReleaseMutex(hDrawMutex);  }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   965
#else
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   966
# define AQUIRE_DRAW_MUTEX     { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   967
# define RELEASE_DRAW_MUTEX    { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   968
#endif
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   969
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   970
static HANDLE hCreateEvent = NULL;
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   971
static HANDLE hNeverTriggered = NULL;
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   972
static HANDLE hInputEvent = NULL;
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
   973
static HANDLE hDispatchThreadRunningEvent = NULL;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   974
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   975
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   976
 static int __cnt_gcData;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   977
 static int __cnt_createWindows;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   978
 static int __cnt_cur;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   979
 static int __cnt_font;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   980
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   981
#ifdef COUNT_BMP_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   982
 static int __cnt_bitmap;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   983
#endif
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   984
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
   985
static struct queuedEvent *eventFreeList  = (struct queuedEvent *) 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
   986
static struct queuedEvent *eventQueueHead = (struct queuedEvent *) 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
   987
static struct queuedEvent *eventQueueTail = (struct queuedEvent *) 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   988
static int eventsendcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   989
static int eventempfcount = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   990
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
   991
/*
2754
21cbbc8fbe09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
   992
 * 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
   993
 * (away from free/malloc)
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   994
 */
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   995
#define NUM_FREE_GC     50
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   996
static struct gcData *gcDataFreeList = (struct gcData *)0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   997
static int gcDataNumFree = 0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   998
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   999
/*
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1000
 * remember the last background-paint brush
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1001
 * will be reused by next bg-paint, if it needs
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1002
 * the same color. Otherwise, the next bg-erase
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1003
 * will destroy this brush.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1004
 */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1005
#ifdef CACHE_LAST_WM_PAINT_BRUSH
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1006
 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
  1007
 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
  1008
#endif
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1009
#ifdef CACHE_LAST_WM_PAINT_DC
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1010
 static HWND last_wm_paint_win = 0;
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1011
 static HDC  last_wm_paint_dc = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1012
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1013
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1014
#ifdef COMPRESS_WINDOWPOSCHANGED
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1015
 static HWND lastPos_win = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1016
 static int lastPos_w;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1017
 static int lastPos_h;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1018
 static int lastPos_x;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1019
 static int lastPos_y;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1020
#endif
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1021
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1022
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1023
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1024
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1025
!WinWorkstation primitiveFunctions!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1026
%{
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1027
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1028
#ifdef xxWIN32THREADS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1029
extern void __suspendAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1030
extern void __resumeAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1031
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1032
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
  1033
static void __debugEvent__() {}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1034
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1035
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1036
static void
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1037
printMask(int mask) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1038
        if (mask & KeyPressMask)        console_printf("KeyPressMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1039
        if (mask & KeyReleaseMask)      console_printf("KeyReleaseMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1040
        if (mask & ButtonPressMask)     console_printf("ButtonPressMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1041
        if (mask & ButtonReleaseMask)   console_printf("ButtonReleaseMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1042
        if (mask & ButtonMotionMask)    console_printf("ButtonMotionMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1043
        if (mask & PointerMotionMask)   console_printf("PointerMotionMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1044
        if (mask & ExposureMask)        console_printf("ExposureMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1045
        if (mask & FocusChangeMask)     console_printf("FocusChangeMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1046
        if (mask & EnterWindowMask)     console_printf("EnterWindowMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1047
        if (mask & LeaveWindowMask)     console_printf("LeaveWindowMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1048
        if (mask & KeymapStateMask)     console_printf("KeymapStateMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1049
        if (mask & VisibilityChangeMask)console_printf("VisibilityChangeMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1050
        if (mask & StructureNotifyMask) console_printf("StructureNotifyMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1051
        if (mask & ResizeRedirectMask)  console_printf("ResizeRedirectMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1052
        if (mask & PropertyChangeMask)  console_printf("PropertyChangeMask\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1053
        if (mask & ColormapChangeMask)  console_printf("ColormapChangeMask\n");
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1054
}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1055
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1056
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1057
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1058
st2RGB(int color, struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1059
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1060
        int ir,ig,ib;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1061
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1062
        if (gcData) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1063
            if (gcData->bitmapColorBitCount == 1) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1064
              if (color)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1065
                  return WhitePixel;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1066
              else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1067
                  return BlackPixel;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1068
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1069
        }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1070
#ifdef ALWAYSTRUECOLOR
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1071
        return (color & 0xffffff);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1072
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1073
        if (__depth < 15) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1074
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1075
        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1076
            if ((__depth == 16) || (__depth == 15)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1077
                ib = (color & 0x1f) << 3;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1078
                ig = ((color >> 5) & 0x3f) << 2;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1079
                ir = ((color >> 11) & 0x1f) << 3;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1080
                ir |= 7;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1081
                ig |= 3;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1082
                ib |= 7;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1083
                return RGB(ir,ig,ib);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1084
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1085
            return (color & 0xffffff);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1086
        }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1087
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1088
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1089
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1090
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1091
RGB2st(r, g, b)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1092
    int r, g, b;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1093
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1094
        int ir,ig,ib,id;
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
  1095
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1096
#ifdef ALWAYSTRUECOLOR
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1097
        ir = (r >> 8) & 0xff;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1098
        ig = (g >> 8) & 0xff;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1099
        ib = (b >> 8) & 0xff;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1100
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1101
        id = RGB( ir, ig, ib);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1102
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1103
        if (__depth < 15) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1104
            id = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1105
        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1106
            if ((__depth == 16) || (__depth == 15)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1107
                ir = (r >> 11) & 0x1f;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1108
                ig = (g >> 10) & 0x3f;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1109
                ib = (b >> 11) & 0x1f;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1110
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1111
                id = ( ir << 11 ) | ( ig << 5 ) | ib;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1112
            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1113
                ir = (r >> 8) & 0xff;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1114
                ig = (g >> 8) & 0xff;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1115
                ib = (b >> 8) & 0xff;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1116
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1117
                id = RGB( ir, ig, ib);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1118
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1119
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1120
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1121
        return id;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1122
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1123
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1124
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1125
/*
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1126
 * return a windows top-window
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1127
 */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1128
static HWND
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1129
GetTopParent(hWnd)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1130
    HWND hwnd;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1131
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1132
        HWND lastParent = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1133
        HWND nextParent;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1134
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1135
        while (nextParent = GetParent(lastParent)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1136
            lastParent = nextParent;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1137
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1138
        return lastParent;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1139
}
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1140
#endif
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1141
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1142
#ifdef DEBUG_DELETEOBJECT
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1143
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1144
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1145
_DeleteObject(o, lineNr)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1146
    HANDLE o;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1147
{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1148
    int r = DeleteObject(o);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1149
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1150
    if (r == 0)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1151
        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
  1152
    return r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1153
}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1154
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1155
#else
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1156
# define _DeleteObject(o,lnr)  DeleteObject(o)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1157
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1158
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1159
static void
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1160
_DeleteFont(f, lineNr)
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1161
    HFONT f;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1162
{
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1163
#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
  1164
    if (f == __tmpDC_hfont) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1165
        SelectObject(__tmpDC, __tmpDC_prev_hfont);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1166
        __tmpDC_hfont = NULL;
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1167
    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1168
#endif
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1169
    _DeleteObject(f, lineNr);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1170
}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1171
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1172
static int
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1173
_DeleteBrush(br, lineNr)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1174
    HBRUSH br;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1175
{
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1176
    int r;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1177
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1178
    if ((br != __whiteBrush)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1179
     && (br != __blackBrush)) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1180
        r = DeleteObject(br);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1181
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1182
        if (r == 0)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1183
            console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteBrush %x [%d]\n", br, lineNr);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1184
        return r;
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1185
    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1186
    return 1;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1187
}
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1188
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1189
static int
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1190
_DeletePen(p, lineNr)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1191
    HPEN p;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1192
{
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1193
    int r;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1194
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1195
    if ((p != __whitePen)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1196
     && (p != __blackPen)) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1197
        r = DeleteObject(p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1198
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1199
        if (r == 0)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1200
            console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeletePen %x [%d]\n", p, lineNr);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1201
        return r;
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1202
    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1203
    return 1;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1204
}
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1205
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1206
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1207
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1208
static int
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1209
_DeletePenIfNotInCache(p, lineNr)
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1210
    HPEN p;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1211
{
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1212
    int i, r;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1213
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1214
    if ((p == __whitePen)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1215
     || (p == __blackPen)) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1216
        return 1; /* not deleted, but OK */
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1217
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1218
    for (i=0; i<NUM_PEN_CACHED;i++) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1219
        if (__penCache[i].pen == p) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1220
            return 1; /* not deleted, but OK */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1221
        }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1222
    }
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1223
    r = DeleteObject(p);
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1224
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1225
    if (r == 0)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1226
        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
  1227
    return r;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1228
}
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1229
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1230
#else
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1231
# define _DeletePenIfNotInCache(p, lineNr)   _DeletePen(p, lineNr)
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1232
#endif /* CACHE_PEN */
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1233
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1234
#ifdef CACHE_BRUSH
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1235
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1236
static int
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1237
_DeleteBrushIfNotInCache(br, lineNr)
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1238
    HBRUSH br;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1239
{
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1240
    int i, r;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1241
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1242
    for (i=0; i<NUM_BRUSH_CACHED;i++) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1243
        if (__brushCache[i].brush == br) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1244
            return 1; /* not deleted, but OK */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1245
        }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1246
    }
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1247
    if ((br == __whiteBrush)
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1248
     || (br == __blackBrush)) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1249
        return 1; /* not deleted, but OK */
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1250
    }
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1251
    r = DeleteObject(br);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1252
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1253
    if (r == 0)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1254
        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
  1255
    return r;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1256
}
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1257
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1258
#else
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1259
# define _DeleteBrushIfNotInCache(br, lineNr)   _DeleteBrush(br, lineNr)
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1260
#endif /* CACHE_BRUSH */
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1261
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1262
static struct gcData *
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
  1263
newGcData(void)
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1264
{
5575
Stefan Vogel <sv@exept.de>
parents: 5574
diff changeset
  1265
    struct gcData *gcData;
Stefan Vogel <sv@exept.de>
parents: 5574
diff changeset
  1266
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1267
    if (gcDataFreeList) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1268
        gcData = gcDataFreeList;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1269
        gcDataFreeList = gcData->u.__nextFree;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1270
        gcDataNumFree--;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1271
    } else {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1272
        gcData = (struct gcData *) malloc(sizeof(struct gcData));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1273
        if (! gcData) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1274
            console_fprintf(stderr, "WinWorkstat [warning]: failed to allocate gcData\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1275
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1276
        }
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1277
    }
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1278
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1279
    memset(gcData, 0, sizeof(struct gcData));
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  1280
    gcData->fgColor = 0xffffff;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1281
    /* gcData->bgColor = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1282
    gcData->clipping = FALSE;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1283
    gcData->clipByChildren = TRUE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1284
    gcData->bitbltrop2 = BITBLT_COPY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1285
    gcData->lineWidth = 1;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1286
    gcData->lStyle = PS_SOLID | PS_JOIN_MITER | PS_ENDCAP_FLAT;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1287
    /* 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
  1288
    /* 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
  1289
    /* gcData->hBrush = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1290
    return gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1291
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1292
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1293
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1294
freeGcData(struct gcData *gcData)
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1295
{
2754
21cbbc8fbe09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
  1296
    if (gcDataNumFree < NUM_FREE_GC) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1297
        gcData->u.__nextFree = gcDataFreeList;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1298
        gcDataFreeList = gcData;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1299
        gcDataNumFree++;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1300
    } else {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1301
        free(gcData);
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1302
    }
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1303
}
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1304
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1305
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1306
# 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
  1307
    if (lastGcData == __gcData__) {  \
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1308
        _releaseDC(lastGcData);      \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1309
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1310
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1311
# 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
  1312
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1313
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1314
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1315
# 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
  1316
    if (__gcData__->hPen) {           \
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1317
        if (__gcData__->save_hPen) {  \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1318
            SelectObject(__gcData__->_hDC, __gcData__->save_hPen); \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1319
            __gcData__->save_hPen = 0;   \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1320
        } \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1321
        _DeletePenIfNotInCache(__gcData__->hPen, __LINE__); \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1322
        __gcData__->hPen = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1323
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1324
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1325
# 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
  1326
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1327
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1328
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1329
# 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
  1330
    if (__gcData__->hBrush) {           \
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1331
        if (__gcData__->save_hBrush) {  \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1332
            SelectObject(__gcData__->_hDC, __gcData__->save_hBrush); \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1333
            __gcData__->save_hBrush = 0;   \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1334
        } \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1335
        _DeleteBrushIfNotInCache(__gcData__->hBrush, __LINE__); \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1336
        __gcData__->hBrush = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1337
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1338
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1339
# 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
  1340
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1341
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1342
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1343
_releaseDC(struct gcData *gcData)
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1344
{
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1345
    HDC hDC = gcData->_hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1346
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1347
    if (gcData->doNotCacheOrRelease ) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1348
        return;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1349
    }
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1350
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1351
    if (gcData->save_hPen) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1352
        SelectObject(hDC, gcData->save_hPen);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1353
        gcData->save_hPen = 0;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1354
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1355
    if (gcData->save_hBrush) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1356
        SelectObject(hDC, gcData->save_hBrush);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1357
        gcData->save_hBrush = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1358
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1359
    if (gcData->save_hFont) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1360
        SelectObject(hDC, gcData->save_hFont);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1361
        gcData->save_hFont = 0;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1362
    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1363
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1364
    if (gcData->hWnd) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1365
        if (hDC) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1366
            ReleaseDC(gcData->hWnd, hDC);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1367
#ifdef CACHE_LAST_WM_PAINT_DC
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1368
            if (hDC == last_wm_paint_dc) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1369
                last_wm_paint_dc = last_wm_paint_win = 0;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  1370
# ifdef DEBUG_DC_REUSE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1371
                console_fprintf(stderr, "WinWorkstation [info]: Oops - releasing bg_paint-dc\n");
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  1372
# endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1373
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1374
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1375
        }
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1376
    } else if (gcData->hBitmap) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1377
        SelectObject(hDC, gcData->save_hBitmap);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1378
        DeleteDC(hDC);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1379
    }
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1380
    gcData->_hDC = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1381
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1382
#ifdef CACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1383
    if (lastGcData == gcData) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1384
        lastGcData = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1385
    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1386
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1387
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1388
    if (gcData->hPen) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1389
        _DeletePenIfNotInCache(gcData->hPen, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1390
        gcData->hPen = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1391
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1392
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1393
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1394
    if (gcData->hBrush) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1395
        _DeleteBrushIfNotInCache(gcData->hBrush, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1396
        gcData->hBrush = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1397
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1398
#endif
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1399
}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1400
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1401
static HDC
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1402
_getDC(struct gcData *gcData)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1403
{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1404
    HDC hDC;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1405
    int currThreadId;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1406
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1407
    if (gcData->doNotCacheOrRelease ) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1408
        return gcData->_hDC;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1409
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1410
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1411
#ifdef CACHE_LAST_DC
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1412
    currThreadId = GetCurrentThreadId();
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1413
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1414
    if (lastGcData) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1415
        if ((lastGcData == gcData)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1416
         && (lastGcHWIN == gcData->hWnd)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1417
         && (lastGcHBITMAP == gcData->hBitmap)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1418
         && (lastGcOwnerThreadID == currThreadId)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1419
         && gcData->_hDC
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1420
        ) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1421
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1422
            if (last_wm_paint_dc == gcData->_hDC) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1423
#  ifdef DEBUG_DC_REUSE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1424
                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
  1425
#  endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1426
                last_wm_paint_dc = last_wm_paint_win = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1427
            }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1428
# endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1429
            return gcData->_hDC;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1430
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1431
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1432
        _releaseDC(lastGcData);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1433
        lastGcData = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1434
    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1435
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1436
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1437
    hDC = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1438
    if (gcData->hWnd != 0) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1439
        if (gcData->hWnd == __rootWin) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1440
            hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_WINDOW);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1441
        } else if (gcData->clipByChildren) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1442
            //gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_CLIPCHILDREN);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1443
            hDC = gcData->_hDC = GetDC(gcData->hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1444
        } else  {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1445
            hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_PARENTCLIP);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1446
        }
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1447
    } else if (gcData->hBitmap) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1448
        hDC = gcData->_hDC = CreateCompatibleDC(__tmpDC);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1449
        gcData->save_hBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1450
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1451
    gcData->bkMode = BK_UNDEF;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1452
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1453
    if (hDC) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1454
        SetTextColor(hDC, gcData->fgColor);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1455
        SetBkColor(hDC, gcData->bgColor);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1456
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1457
        if (gcData->rop2)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1458
            SetROP2(hDC, gcData->rop2);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1459
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1460
        if (gcData->clipping) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1461
            HRGN region = CreateRectRgn( gcData->clipX, gcData->clipY,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1462
                                         gcData->clipX + gcData->clipW,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1463
                                         gcData->clipY + gcData->clipH);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1464
            if (region == NULL ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1465
                console_fprintf(stderr, "WinWorkstat [warning]: clipping region creation failed\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1466
            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1467
                if (SelectClipRgn(hDC, region) == ERROR ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1468
                    DPRINTF(("WinWorkstat [warning]: select clipping region failed\n" ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1469
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1470
                _DeleteObject(region, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1471
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1472
        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1473
            SelectClipRgn(hDC, NULL);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1474
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1475
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1476
        if (gcData->hFont) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1477
            HFONT prevFont;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1478
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1479
            prevFont = SelectObject(hDC, gcData->hFont);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1480
            if (! gcData->save_hFont) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1481
                gcData->save_hFont = prevFont;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1482
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1483
        }
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1484
    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1485
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1486
#ifdef CACHE_LAST_DC
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1487
    lastGcData = gcData;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1488
    lastGcOwnerThreadID = currThreadId;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1489
    lastGcHWIN = gcData->hWnd;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1490
    lastGcHBITMAP = gcData->hBitmap;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1491
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1492
    gcData->_hDC = hDC;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1493
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1494
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1495
    if (last_wm_paint_dc == hDC) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1496
#  ifdef DEBUG_DC_REUSE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1497
        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
  1498
#  endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1499
        last_wm_paint_dc = last_wm_paint_win = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1500
    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1501
# endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1502
#endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1503
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1504
    return hDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1505
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1506
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1507
static HBRUSH
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1508
GcDataGetBrush(HDC hDC, struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1509
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1510
    HBRUSH hBrush = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1511
    HBRUSH prevBrush;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1512
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1513
#ifdef CACHE_LAST_BRUSH
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1514
    if (hBrush = gcData->hBrush) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1515
        if (! gcData->save_hBrush) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1516
            gcData->save_hBrush = SelectObject(gcData->_hDC, hBrush);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1517
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1518
        return hBrush;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1519
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1520
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1521
    if (gcData->hMask) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1522
        hBrush = CreatePatternBrush(gcData->hMask);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1523
        SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1524
        RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1525
    } else {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1526
        if (gcData->fgColor == BlackPixel) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1527
            hBrush = __blackBrush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1528
        } else if (gcData->fgColor == WhitePixel) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1529
            hBrush = __whiteBrush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1530
        } else {
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1531
#ifdef CACHE_BRUSH
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1532
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1533
                int i;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1534
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1535
                for (i=0; i<NUM_BRUSH_CACHED; i++) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1536
                    if (__brushCache[i].clr == gcData->fgColor) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1537
                        hBrush = __brushCache[i].brush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1538
                        /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1539
                         * move it up in the cache
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1540
                         */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1541
                        if (i > 0) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1542
                            HBRUSH t = __brushCache[i-1].brush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1543
                            int c = __brushCache[i-1].clr;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1544
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1545
                            __brushCache[i-1].brush = hBrush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1546
                            __brushCache[i-1].clr = gcData->fgColor;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1547
                            __brushCache[i].brush = t;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1548
                            __brushCache[i].clr = c;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1549
                        }
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1550
# ifdef CACHE_LAST_BRUSH
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1551
                        prevBrush = SelectObject(gcData->_hDC, hBrush);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1552
                        if (! gcData->save_hBrush) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1553
                            gcData->save_hBrush = prevBrush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1554
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1555
                        gcData->hBrush = hBrush;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1556
# endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1557
                        return hBrush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1558
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1559
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1560
            }
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1561
#endif /* BRUSH_CACHE */
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1562
            hBrush = CreateSolidBrush(gcData->fgColor);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1563
            RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1564
        }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1565
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1566
    gcData->hBrush = hBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1567
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1568
    prevBrush = SelectObject(gcData->_hDC, hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1569
    if (! gcData->save_hBrush) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1570
        gcData->save_hBrush = prevBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1571
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1572
    return hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1573
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1574
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1575
#ifdef CACHE_LAST_BRUSH
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1576
# define GcDataReleaseBrush(hDC, gcData)  /* nothing*/
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1577
#else
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1578
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1579
GcDataReleaseBrush(HDC hDC, struct gcData *gcData)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1580
{
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1581
    HBRUSH hBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1582
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1583
    hBrush = gcData->hBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1584
    if (gcData->save_hBrush) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1585
        SelectObject(hDC, gcData->save_hBrush);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1586
        gcData->save_hBrush = NULL;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1587
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1588
    _DeleteBrushIfNotInCache(hBrush, __LINE__);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1589
    gcData->hBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1590
}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1591
#endif
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1592
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1593
static HPEN
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1594
GcDataGetPen(HDC hDC, struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1595
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1596
    HPEN hPen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1597
    HPEN prevPen;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1598
    LOGBRUSH Brush;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1599
    int lw;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1600
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1601
#ifdef CACHE_LAST_PEN
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1602
    if (hPen = gcData->hPen) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1603
        if (! gcData->save_hPen) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1604
            gcData->save_hPen = SelectObject(gcData->_hDC, hPen);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1605
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1606
        return hPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1607
    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1608
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1609
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1610
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1611
     && (gcData->hMask == 0)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1612
     && (gcData->lineWidth <= 1)) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1613
        if (gcData->fgColor == BlackPixel) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1614
            gcData->hPen = hPen = __blackPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1615
            prevPen = SelectObject(hDC, hPen);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1616
            if (! gcData->save_hPen) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1617
                gcData->save_hPen = prevPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1618
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1619
            return hPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1620
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1621
        if (gcData->fgColor == WhitePixel) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1622
            gcData->hPen = hPen = __whitePen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1623
            prevPen = SelectObject(hDC, hPen);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1624
            if (! gcData->save_hPen) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1625
                gcData->save_hPen = prevPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1626
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1627
            return hPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1628
        }
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1629
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1630
#ifdef CACHE_PEN
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1631
        {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1632
            int i;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1633
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1634
            for (i=0; i<NUM_PEN_CACHED; i++) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1635
                if (__penCache[i].clr == gcData->fgColor) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1636
                    hPen = __penCache[i].pen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1637
                    /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1638
                     * move it up in the cache
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1639
                     */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1640
                    if (i > 0) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1641
                        HPEN t = __penCache[i-1].pen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1642
                        int c = __penCache[i-1].clr;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1643
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1644
                        __penCache[i-1].pen = hPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1645
                        __penCache[i-1].clr = gcData->fgColor;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1646
                        __penCache[i].pen = t;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1647
                        __penCache[i].clr = c;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1648
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1649
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1650
                    gcData->hPen = hPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1651
                    prevPen = SelectObject(hDC, hPen);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1652
                    if (! gcData->save_hPen) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1653
                        gcData->save_hPen = prevPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1654
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1655
                    return hPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1656
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1657
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1658
        }
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1659
#endif /* PEN_CACHE */
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1660
    }
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1661
4149
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
  1662
    hPen = (HPEN) 0;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1663
    lw = gcData->lineWidth;
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1664
    if (lw == 0) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1665
        lw = 1;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1666
    }
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1667
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1668
    /*
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1669
     * 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
  1670
     * 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
  1671
     */
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1672
    if (gcData->hMask) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1673
        Brush.lbStyle = BS_PATTERN;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1674
        Brush.lbHatch = (DWORD)gcData->hMask;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1675
        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
  1676
    } else {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1677
        Brush.lbStyle = BS_SOLID;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1678
        Brush.lbHatch = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1679
        Brush.lbColor = gcData->fgColor;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1680
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1681
        hPen = (HPEN) 0;
5661
52da326a0fe1 use ExtCreatePen not CreatePen search for: USE_OLD_CREATE_PEN
ca
parents: 5660
diff changeset
  1682
52da326a0fe1 use ExtCreatePen not CreatePen search for: USE_OLD_CREATE_PEN
ca
parents: 5660
diff changeset
  1683
#if USE_OLD_CREATE_PEN
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1684
        hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK), lw, gcData->fgColor);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1685
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1686
        RESPRINTF(("CreatePen %x %d(%d) %x %x\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1687
                    gcData->lStyle,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1688
                    lw, gcData->lineWidth,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1689
                    gcData->fgColor, gcData->hMask));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1690
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1691
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1692
        SetBkMode(hDC, TRANSPARENT);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1693
        gcData->bkMode = BK_TRANSPARENT;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1694
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1695
        if (! hPen) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1696
            hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1697
                            lw, /* gcData->lineWidth, */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1698
                            &Brush,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1699
                            0, 0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1700
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1701
            RESPRINTF(("ExtCreatePen1 %x %d(%d) %x %x\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1702
                        gcData->lStyle,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1703
                        lw, gcData->lineWidth,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1704
                        gcData->fgColor, gcData->hMask));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1705
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1706
            if (gcData->hMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1707
                SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1708
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1709
        }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1710
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1711
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1712
    gcData->hPen = hPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1713
    prevPen = SelectObject(hDC, hPen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1714
    if (! gcData->save_hPen) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1715
        gcData->save_hPen = prevPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1716
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1717
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1718
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1719
    /*
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1720
     * remember in penCache
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1721
     */
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1722
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1723
     && (gcData->hMask == 0)
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1724
     && (gcData->lineWidth <= 1)) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1725
        int i;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1726
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1727
        /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1728
         * search for an empty slot
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1729
         */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1730
        for (i=0; i<NUM_PEN_CACHED; i++) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1731
            if (__penCache[i].pen == 0) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1732
                __penCache[i].clr = gcData->fgColor;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1733
                __penCache[i].pen = hPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1734
                break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1735
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1736
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1737
        if (i == NUM_PEN_CACHED) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1738
            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1739
             * replace last in penCache
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1740
             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1741
            HPEN t = __penCache[NUM_PEN_CACHED - 1].pen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1742
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1743
            __penCache[NUM_PEN_CACHED - 1].pen = hPen;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1744
            __penCache[NUM_PEN_CACHED - 1].clr = gcData->fgColor;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1745
            _DeletePen(t, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1746
        }
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1747
    }
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1748
#endif
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1749
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1750
    return hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1751
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1752
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1753
#ifdef CACHE_LAST_PEN
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1754
# define GcDataReleasePen(HDC hDC, struct gcData *gcData)  /* nothing*/
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1755
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1756
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1757
GcDataReleasePen(HDC hDC, struct gcData *gcData)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1758
{
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1759
    HPEN hPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1760
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1761
    if (gcData->save_hPen) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1762
        SelectObject(hDC, gcData->save_hPen);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1763
        gcData->save_hPen = NULL;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1764
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1765
    hPen = gcData->hPen;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1766
    _DeletePenIfNotInCache(hPen, __LINE__);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1767
    gcData->hPen = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1768
}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1769
#endif /* CACHE_LAST_PEN */
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1770
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1771
/* atze */
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1772
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1773
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1774
lockEvents(char *whoIsLocking)
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1775
{
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1776
    DWORD dwWaitResult = WaitForSingleObject(hEventsMutex, 5000L);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1777
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1778
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1779
    lockCountEvents++;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1780
    if (lockCountEvents != 1) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1781
        console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 1 in lock\n", lockCountEvents);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1782
        lockCountEvents = 1;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1783
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1784
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1785
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1786
    switch (dwWaitResult) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1787
        case WAIT_OBJECT_0:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1788
            hEventsMutexOwner = whoIsLocking;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1789
            return (TRUE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1790
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1791
        case WAIT_ABANDONED:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1792
            console_fprintf(stderr, "WinWorkstation [warning]: lockEvent abandoned (was owned by %s)\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1793
                        (hEventsMutexOwner ? hEventsMutexOwner : "NONE"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1794
            hEventsMutexOwner = whoIsLocking;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1795
            return (TRUE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1796
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1797
        case WAIT_TIMEOUT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1798
            console_fprintf(stderr, "WinWorkstation [warning]: lockEvent timeout (owned by %s)\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1799
                        (hEventsMutexOwner ? hEventsMutexOwner : "NONE") );
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1800
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1801
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1802
        default:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1803
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1804
                unsigned errCode = GetLastError();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1805
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1806
                console_fprintf(stderr, "WinWorkstation [error]: lockEvent error (owned by %s) rslt=0x%x err=0x%x\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1807
                            (hEventsMutexOwner ? hEventsMutexOwner : "NONE"),
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1808
                            dwWaitResult, errCode );
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1809
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1810
            break;
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1811
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1812
    return (FALSE);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1813
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1814
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1815
static int
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1816
unlockEvents() {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1817
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1818
    lockCountEvents--;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1819
    if (lockCountEvents != 0) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1820
        console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 0 in unlock\n", lockCountEvents);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1821
        lockCountEvents = 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1822
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1823
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1824
    if (! ReleaseMutex(hEventsMutex)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  1825
       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
  1826
       return (FALSE);
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1827
    }
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1828
    hEventsMutexOwner = NULL;
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1829
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1830
    return (TRUE);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1831
}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1832
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1833
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1834
static int
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1835
initEventqueue() {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1836
    struct queuedEvent *bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1837
    int i;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1838
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1839
    bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1840
    if (bulk == 0) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1841
        console_fprintf(stderr, "WinWorkstation [warning]: no memory for dispatchqueue\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1842
        return 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1843
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1844
    for (i=1; i<EV_CHUNK_CNT; i++) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1845
        bulk[i-1].ev_next = &(bulk[i]);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1846
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1847
    bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1848
    eventFreeList = bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1849
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1850
    return 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1851
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1852
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1853
#define EV_NOTIME       0
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1854
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1855
#define enqEvent(a1, a2, a3, a4, a5, a6, a7, a8, a9) \
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1856
    __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
  1857
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1858
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1859
__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
  1860
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1861
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1862
    int repeatCount = 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1863
4445
c83f9aebaf41 comment
Claus Gittinger <cg@exept.de>
parents: 4444
diff changeset
  1864
    /* get an event struct
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1865
    */
4445
c83f9aebaf41 comment
Claus Gittinger <cg@exept.de>
parents: 4444
diff changeset
  1866
    while (! eventFreeList) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1867
        if (repeatCount++ >= 5) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1868
            /* throw away sorry */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1869
            console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1870
            return;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1871
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1872
        console_fprintf(stderr, "WinWorkstation [warning]: wait for event memory (%d)\n", repeatCount);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1873
        WaitForSingleObject( hNeverTriggered, 100L );
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1874
    }
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1875
    if (! lockEvents("enqEvent")) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1876
        console_fprintf(stderr, "WinWorkstation [error]: event throw away (lock problem)\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1877
        return;
4363
d7a017ae1487 *** empty log message ***
penk
parents: 4353
diff changeset
  1878
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1879
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1880
    ev = eventFreeList;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1881
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1882
    if (! ev) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1883
        console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1884
        unlockEvents();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1885
        return;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1886
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1887
    eventFreeList  = ev->ev_next;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1888
    ev->ev_flag    = flag;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1889
    ev->ev_hWnd    = hWnd;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1890
    ev->ev_message = message;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1891
    ev->ev_wParam  = wParam;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1892
    ev->ev_arg1    = arg1;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1893
    ev->ev_arg2    = arg2;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1894
    ev->ev_arg3    = arg3;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1895
    ev->ev_arg4    = arg4;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1896
    ev->ev_time    = evTime /* lastMSGTime */;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1897
    ev->count      = eventsendcount++;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1898
    ev->ev_next    = (struct queuedEvent *) 0;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1899
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1900
    if (eventQueueTail) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1901
        eventQueueTail->ev_next = ev;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1902
    } else {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1903
        eventQueueHead = ev;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1904
    }
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1905
    eventQueueTail = ev;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1906
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1907
    unlockEvents();
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1908
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1909
    if (eventQueueHead == ev) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1910
        SetEvent(hInputEvent);
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1911
    }
2511
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1912
2337
79f957096b99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1913
#if 0
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  1914
    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
  1915
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1916
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1917
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1918
static int
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1919
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
  1920
{
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1921
    struct queuedEvent * ev = NULL;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1922
    char * freeArg2 = NULL;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1923
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1924
    if (mask != ~0) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1925
        PRINTF(("deqEvent mask:%x\n",mask));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1926
    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1927
    if (hWnd) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1928
        PRINTF(("deqEvent hWnd:%x\n",hWnd));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1929
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1930
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1931
  again:
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1932
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1933
    if (! eventQueueHead)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1934
        return (0);
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1935
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1936
    if (! lockEvents("deqEvent")) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1937
        return (0);
4363
d7a017ae1487 *** empty log message ***
penk
parents: 4353
diff changeset
  1938
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1939
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1940
    TH_DPRINTF(("TDEQ\n"));
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1941
    ev = eventQueueHead;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1942
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1943
    if (! ev) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1944
        unlockEvents();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1945
        return (0);
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1946
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1947
    eventQueueHead = ev->ev_next;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1948
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1949
    if (! eventQueueHead) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1950
        eventQueueTail = (struct queuedEvent *) 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1951
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1952
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1953
    if (ev->count != -1) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1954
        static int anyGoodEventReceived = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1956
        if (eventempfcount != ev->count) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1957
            if (anyGoodEventReceived) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1958
                console_fprintf(stderr, "WinWorkstation [warning]: lost event (eventcount error %d <-> %d)\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1959
                                 eventempfcount, ev->count);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1960
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1961
            eventempfcount = ev->count;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1962
            anyGoodEventReceived = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1963
        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1964
            anyGoodEventReceived = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1965
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1966
        eventempfcount++;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1967
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1968
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1969
    if (ev->ev_message == WM_DESTROY) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1970
        /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1971
         * arg2 is the localInfoPtr
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1972
         * (which is already cleared in the wind-structure)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1973
         * it must be freed by the stx-process ('cause it was malloc'd by it)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1974
         */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1975
        if (ev->ev_arg2) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1976
            freeArg2 = (char *) ev->ev_arg2;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1977
            ev->ev_arg2 = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1978
        }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1979
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1980
#ifdef TOPWINDOWCLASS
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1981
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1982
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
  1983
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1984
        if (ev->ev_arg1) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1985
            if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1986
                /*console_printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1987
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1988
            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1989
                /* noch einmal in die queue
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1990
                */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1991
                if (ev->ev_arg2++ < 100) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1992
                    ev->ev_next = (struct queuedEvent *)0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1993
                    ev->count   = eventsendcount++;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1994
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1995
                    if (eventQueueTail) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1996
                        eventQueueTail->ev_next = ev;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1997
                    } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1998
                        eventQueueHead = ev;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  1999
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2000
                    eventQueueTail = ev;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2001
                    unlockEvents();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2002
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2003
                    if (freeArg2) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2004
                        free (freeArg2);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2005
                        freeArg2 = NULL;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2006
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2007
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2008
                    if (ev->ev_arg2 > 98) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2009
                        console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed. Wait 1 sec.\n",(char*)ev->ev_arg1);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2010
                        sleep(1);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2011
                    } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2012
                        sleep(0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2013
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2014
                    goto again;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2015
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2016
                /* fail evtl. später ändern und in st verzögert aufrufen
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2017
                */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2018
                console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2019
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2020
            free((char*)ev->ev_arg1);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2021
            ev->ev_arg1 = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2022
        }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2023
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2024
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2025
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2026
    *ret_ev = *ev;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2027
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2028
    ev->ev_next   = eventFreeList;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2029
    eventFreeList = ev;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2030
    unlockEvents();
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2031
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2032
    if (freeArg2) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2033
        free (freeArg2);
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2034
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2035
    return (1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2036
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2037
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2038
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2039
__clearRectangles(HWND hWnd, int numRects, RECT *pRect)
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2040
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2041
        HDC dc;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2042
        HBRUSH br;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2043
        int bgClr;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2044
        int isPrivateBrush = 0;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2045
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2046
# ifdef CACHE_LAST_WM_PAINT_DC
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2047
        AQUIRE_PAINT_MUTEX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2048
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2049
        if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2050
            dc = last_wm_paint_dc;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2051
        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2052
            if (last_wm_paint_dc) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2053
#  ifdef CACHE_LAST_DC
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2054
                if (lastGcData && (lastGcData->_hDC == last_wm_paint_dc)) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2055
#   ifdef DEBUG_DC_REUSE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2056
                    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
  2057
#   endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2058
                    _releaseDC(lastGcData);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2059
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2060
                    ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2061
                }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2062
#  else
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2063
                ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2064
#  endif /* CACHE_LAST_DC */
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2065
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2066
            dc = GetDC(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2067
            last_wm_paint_dc = dc;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2068
            last_wm_paint_win = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2069
        }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2070
# else
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2071
        dc = (HDC)GetDC(hWnd);
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2072
# endif /* CACHE_LAST_WM_PAINT_DC */
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2073
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2074
# ifdef CACHE_LAST_DC
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2075
        if (lastGcData && (lastGcData->_hDC == dc)) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2076
#  ifdef DEBUG_DC_REUSE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2077
            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
  2078
#  endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2079
            if ((lastGcData->rop2 != R2_COPYPEN)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2080
             || (lastGcData->bitbltrop2 != BITBLT_COPY)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2081
                console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc not in Copy mode\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2082
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2083
            lastGcData = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2084
        }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2085
# endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2086
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2087
        br = GetWindow_viewBgBrush(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2088
        if (! br) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2089
            bgClr = GetWindow_viewBgColor(hWnd);
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2090
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2091
# ifdef CACHE_LAST_WM_PAINT_BRUSH
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2092
            if (last_wm_paint_brush
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2093
             && (last_wm_paint_brush_clr == bgClr)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2094
                br = last_wm_paint_brush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2095
            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2096
                if (bgClr == WhitePixel) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2097
                    br = __whiteBrush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2098
                } else if (bgClr == BlackPixel) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2099
                    br = __blackBrush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2100
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2101
                    if (last_wm_paint_brush) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2102
                        _DeleteBrush(last_wm_paint_brush, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2103
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2104
                    last_wm_paint_brush = br = CreateSolidBrush(bgClr);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2105
                    last_wm_paint_brush_clr = bgClr;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2106
                    isPrivateBrush = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2107
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2108
            }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2109
# else
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2110
            br = CreateSolidBrush(bgClr);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2111
            isPrivateBrush = 1;
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2112
# endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2113
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2114
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2115
        if (! br) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2116
            console_fprintf(stderr, "WinWorkstation [info]: no brush\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2117
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2118
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2119
        if (br) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2120
            int i;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2121
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2122
            SelectClipRgn(dc, NULL);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2123
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2124
            for (i=0; i<numRects; i++) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2125
                /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2126
                 * always clear - even if not interested in exposes
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2127
                 */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2128
                FillRect(dc, &(pRect[i]), br);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2129
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2130
        }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2131
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2132
# ifndef CACHE_LAST_WM_PAINT_BRUSH
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2133
        if (isPrivateBrush) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2134
            _DeleteBrush(br, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2135
        }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2136
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2137
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2138
# ifndef CACHE_LAST_WM_PAINT_DC
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2139
        ReleaseDC(hWnd, dc);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2140
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2141
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  2142
# if defined(CACHE_LAST_WM_PAINT_DC)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2143
        RELEASE_PAINT_MUTEX
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2144
# endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2145
}
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2146
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2147
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2148
__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
  2149
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2150
        RECT rect;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2151
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2152
        rect.left = x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2153
        rect.top = y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2154
        rect.right = x + w;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2155
        rect.bottom = y + h;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2156
        __clearRectangles(hWnd, 1, &rect);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2157
}
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2158
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2159
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2160
/*
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2161
 * 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
  2162
 * return the number of events (>0), if any was generated.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2163
 * 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
  2164
 * if a region is passed in, it is not destroyed.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2165
 */
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2166
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2167
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2168
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2169
__generateExposes(HWND hWnd, HRGN hRgnInOrNull, int msgType, int doClear)
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2170
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2171
        RECT updRect;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2172
        HRGN updRgn = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2173
        int numRects, ret, n, i;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2174
        int wantExpose;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2175
        RECT *pRect;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2176
        union {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2177
            RGNDATA rgnData;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2178
            char    bytes[512];
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2179
        } data;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2180
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2181
        wantExpose = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2182
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2183
        if( msgType >= 0 )
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2184
            wantExpose = (GetWindow_eventMask(hWnd) & ExposureMask);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2185
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2186
        if (hRgnInOrNull) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2187
            updRgn = hRgnInOrNull;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2188
        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2189
            PAINTSTRUCT ps;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2190
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2191
            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2192
             * fetch the update region, even if ExposureMask is empty.
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2193
             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2194
            updRgn = CreateRectRgn(0, 0, 0, 0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2195
            ret = GetUpdateRgn(hWnd, updRgn, FALSE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2196
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2197
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2198
            BeginPaint(hWnd, &ps);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2199
            /* store the rectangle required for image bit reversal */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2200
            /* updateRect = ps.rcPaint;   */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2201
            EndPaint(hWnd, &ps);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2202
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2203
            switch (ret) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2204
                case ERROR:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2205
                    console_fprintf(stderr, "WinWorkstation [info]: errregion\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2206
                    return -1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2207
                case NULLREGION:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2208
                    DDPRINTF(("nullregion\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2209
                    _DeleteObject(updRgn, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2210
                    return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2211
                case SIMPLEREGION:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2212
                case COMPLEXREGION:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2213
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2214
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2215
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2216
        n = GetRegionData(updRgn, sizeof(data), &(data.rgnData));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2217
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2218
        /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2219
         * the MS-doc states: n==1
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2220
         * but this is not true
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2221
         */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2222
        if ((n >= sizeof(RGNDATA))
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2223
         && (n <= sizeof(data))
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2224
         && (data.rgnData.rdh.iType == RDH_RECTANGLES))  {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2225
            /* ok, got the region */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2226
            numRects = data.rgnData.rdh.nCount;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2227
            pRect = (RECT *)(data.rgnData.Buffer);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2228
            DDPRINTF(("region numRects=%d\n", numRects));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2229
        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2230
            /* a big region ... */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2231
            GetRgnBox(updRgn, &updRect);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2232
            numRects = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2233
            pRect = &updRect;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2234
            DPRINTF(("very complex region (need:%d have:%d) bounds=%d,%d -> %d,%d\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2235
                     n, sizeof(data),
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2236
                     updRect.left, updRect.top,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2237
                     updRect.right, updRect.bottom));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2238
            if (((updRect.right - updRect.left) <= 0)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2239
             || ((updRect.bottom - updRect.top) <= 0)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2240
                numRects = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2241
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2242
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2243
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2244
        if (numRects) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2245
            if (doClear) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2246
                __clearRectangles(hWnd, numRects, pRect);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2247
            }
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2248
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  2249
#ifndef PRE_21_NOV
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2250
        for (i=0; i < numRects; i++) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2251
            ValidateRect( hWnd, &pRect[i] );
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2252
        }
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2253
#endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2254
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2255
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS1
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2256
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2257
                HDC hDC;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2258
                HBRUSH hBrush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2259
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2260
                hBrush = CreateSolidBrush(BlackPixel);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2261
                hDC = GetWindowDC(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2262
                SelectClipRgn(hDC, NULL);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2263
                for (i=0; i<numRects; i++) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2264
                    FillRect(hDC, &(pRect[i]), hBrush);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2265
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2266
                _DeleteBrush(hBrush, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2267
                ReleaseDC(hWnd, hDC);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2268
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2269
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2270
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2271
            if (wantExpose) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2272
                for (i=0; i<numRects; i++) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2273
                    int final = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2274
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2275
                    if ((msgType == __WM_GEXPOSE)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2276
                     && (i == (numRects - 1))) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2277
                        final = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2278
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2279
                    enqEvent(ExposureMask, hWnd, msgType, final,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2280
                             pRect[i].left, pRect[i].top,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2281
                             pRect[i].right - pRect[i].left,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2282
                             pRect[i].bottom - pRect[i].top,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2283
                             EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2284
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2285
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2286
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2287
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2288
        if (updRgn && (updRgn != hRgnInOrNull)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2289
            _DeleteObject(updRgn, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2290
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2291
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2292
        return numRects;
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2293
}
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2294
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2295
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2296
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2297
BOOL CALLBACK
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2298
recursiveExposeGenerator(HWND hChild, LPARAM param)
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2299
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2300
        __generateExposes(hChild, NULL, param, 0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2301
        return TRUE;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2302
}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2303
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2304
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2305
__generateRecursiveExposes(HWND hWnd, int msgType)
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2306
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2307
        EnumChildWindows(hWnd, recursiveExposeGenerator, msgType);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2308
}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2309
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2310
#endif /* sigh */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2311
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2312
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2313
static int
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2314
getModifiers()
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2315
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2316
    int modifiers = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2317
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2318
    if (GetKeyState(VK_SHIFT) & 0x8000)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2319
        modifiers |= ShiftMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2320
    if (GetKeyState(VK_CONTROL) & 0x8000)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2321
        modifiers |= ControlMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2322
#if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2323
    if (GetKeyState(VK_RMENU) & 0x8000)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2324
        modifiers |= RightAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2325
    if (GetKeyState(VK_LMENU) & 0x8000)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2326
        modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2327
#else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2328
    if (GetKeyState(VK_MENU) & 0x8000)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2329
        modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2330
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2331
    if (GetKeyState(VK_LBUTTON) & 0x8000)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2332
        modifiers |= Button1Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2333
    if (GetKeyState(VK_MBUTTON) & 0x8000)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2334
        modifiers |= Button2Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2335
    if (GetKeyState(VK_RBUTTON) & 0x8000)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2336
        modifiers |= Button3Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2337
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2338
    if ((modifiers & AnyButtonMask) == 0) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2339
        __eatingMouseEvents = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2340
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2341
    return modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2342
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2343
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2344
#ifndef PRE_01_APR_04
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2345
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2346
/* 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
  2347
   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
  2348
*/
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2349
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2350
# define MustHandleButtonEvent()\
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2351
    (((__currentCapture == CAPTURE_NONE)       \
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2352
     && (   (GetKeyState(VK_LBUTTON) & 0x8000) \
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2353
         || (GetKeyState(VK_MBUTTON) & 0x8000) \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2354
         || (GetKeyState(VK_RBUTTON) & 0x8000) \
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2355
        )                                      \
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2356
    ) ? 0 : 1)
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2357
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2358
#else
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2359
# define MustHandleButtonEvent()   1
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2360
#endif
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2361
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2362
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2363
#ifdef HANDLE_VIEWGRAVITY
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2364
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2365
struct gravityCallBackInfo {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2366
    HWND parent;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2367
    int  currW, currH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2368
    int  newW, newH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2369
    int  parentWinX, parentWinY;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2370
};
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2371
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2372
static BOOL CALLBACK
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2373
gravityEnumeratorCallBack(HWND hChild, struct gravityCallBackInfo *iP)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2374
{
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2375
    localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2376
    int gravity;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2377
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2378
    if (lI = GETLOCALWINDOWINFOPTR(hChild)) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2379
        if ((gravity = lI->viewGravity) != GRAVITY_NONE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2380
            RECT oldChildRct, oldChildWinRct;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2381
            RECT newChildRct;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2382
            int deltaW, deltaH;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2383
            int anyChange = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2384
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2385
            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2386
             * get its current bounds ...
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2387
             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2388
            GetClientRect(hChild, &oldChildRct);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2389
            deltaW = iP->newW - iP->currW;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2390
            deltaH = iP->newH - iP->currH;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2391
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2392
            GetWindowRect(hChild, &oldChildWinRct);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2393
            oldChildRct.left = oldChildWinRct.left - iP->parentWinX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2394
            oldChildRct.top =  oldChildWinRct.top - iP->parentWinY;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2395
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2396
            newChildRct = oldChildRct;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2397
            switch (gravity) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2398
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2399
                case GRAVITY_N:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2400
                    console_fprintf(stderr, "WinWorkstation [info]: Child %x: North gravity\n", hChild);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2401
                    /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2402
                     * shift to the bottom, for a constant
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2403
                     * distance from the bottom edge;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2404
                     */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2405
                    newChildRct.bottom += deltaH;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2406
                    anyChange = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2407
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2408
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2409
                case GRAVITY_W:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2410
                    console_fprintf(stderr, "WinWorkstation [info]: Child %x: West gravity\n", hChild);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2411
                    /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2412
                     * shift to the right, for a constant
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2413
                     * distance from the right edge;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2414
                     */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2415
                    newChildRct.right += deltaW;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2416
                    anyChange = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2417
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2418
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2419
                case GRAVITY_S:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2420
                    console_fprintf(stderr, "WinWorkstation [info]: Child %x: South gravity\n", hChild);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2421
                    /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2422
                     * shift to the bottom, for a constant
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2423
                     * distance from the bottom edge;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2424
                     */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2425
                    newChildRct.top += deltaH;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2426
                    newChildRct.bottom  += deltaH;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2427
                    anyChange = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2428
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2429
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2430
                case GRAVITY_E:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2431
                    console_fprintf(stderr, "WinWorkstation [info]: Child %x: East gravity\n", hChild);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2432
                    /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2433
                     * shift to the right, for a constant
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2434
                     * distance from the right edge;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2435
                     */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2436
                    newChildRct.right += deltaW;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2437
                    newChildRct.left  += deltaW;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2438
                    anyChange = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2439
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2440
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2441
                case GRAVITY_SE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2442
                    console_fprintf(stderr, "WinWorkstation [info]: Child %x: SouthEast gravity\n", hChild);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2443
                    /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2444
                     * shift to the bottom-right, for a constant
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2445
                     * distance from the bottom-right edge;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2446
                     */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2447
                    newChildRct.right += deltaW;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2448
                    newChildRct.left  += deltaW;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2449
                    newChildRct.top += deltaH;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2450
                    newChildRct.bottom  += deltaH;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2451
                    anyChange = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2452
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2453
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2454
                default:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2455
                    DPRINTF(("Child %x: other gravity\n", hChild));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2456
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2457
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2458
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2459
            if (anyChange) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2460
                if ((newChildRct.left < 0)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2461
                 || (newChildRct.top < 0)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2462
                 || (newChildRct.right >= iP->newW)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2463
                 || (newChildRct.bottom >= iP->newH)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2464
                    console_fprintf(stderr, "WinWorkstation [info]: dont move child to: %d/%d -> %d/%d\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2465
                                    newChildRct.left, newChildRct.top,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2466
                                    newChildRct.right, newChildRct.bottom);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2467
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2468
                    console_fprintf(stderr, "WinWorkstation [info]: move child from %d/%d->%d/%d to: %d/%d->%d/%d\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2469
                                    oldChildRct.left, oldChildRct.top,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2470
                                    oldChildRct.right, oldChildRct.bottom,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2471
                                    newChildRct.left, newChildRct.top,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2472
                                    newChildRct.right, newChildRct.bottom);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2473
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2474
                    SetWindowPos(hChild, (HWND)0,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2475
                                 newChildRct.left, newChildRct.top,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2476
                                 0, 0,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2477
                                 /* SWP_NOSENDCHANGING | */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2478
                                 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2479
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2480
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2481
        }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2482
    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2483
    return TRUE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2484
}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2485
#endif /* HANDLE_VIEWGRAVITY */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2486
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2487
static void
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2488
ch2wch(char *in, wchar_t *out, int nMax)
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2489
{
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2490
    unsigned char *cp = (unsigned char *)in;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2491
    wchar_t *wcp = out;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2492
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2493
    while ((nMax > 1) && cp && *cp) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2494
        *wcp++ = *cp++;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2495
        nMax--;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2496
    }
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2497
    *wcp = 0;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2498
}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2499
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2500
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2501
winEventProcessing(
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2502
        HWND hWnd,         /* window handle                   */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2503
        UINT message,      /* type of message                 */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2504
        UINT wParam,       /* additional information          */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2505
        LONG lParam,       /* additional information          */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2506
        int *pDefault
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2507
    ) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2508
    int curButton;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2509
    int x, y, w, h;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2510
    int isNative = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2511
    UINT evTime;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2512
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2513
    /* kludge - info is in msg-struct,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2514
     * but lost here. (slightly inexact ... but who cares)
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2515
     */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2516
    evTime = lastMSGTime;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2517
    lastMSGTime = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2518
    if (evTime == 0) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2519
        lastMSGTime = GetTickCount();
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2520
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2521
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2522
/*
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2523
    EVENT_PRINTF(("winEvent hWin=0x%x message=0x%x wP=0x%x lP=0x%x\n",
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2524
                        hWnd, message, wParam, lParam));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2525
*/
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2526
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2527
    if (hWnd) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2528
        if (message != WM_MOUSEMOVE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2529
            lastMotionWnd = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2530
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2531
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2532
        isNative = (GetWindow_flag(hWnd) & LI_NATIVEWIN);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2533
        if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2534
            NDPRINTF(("event %d (0x%x) for nativeWindow\n", message, message));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2535
        }
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2536
    }
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2537
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2538
    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2539
     * messages which are enqueued to be handled by the view thread
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2540
     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2541
    switch (message) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2542
        case WM_THREAD_CREATEWINDOW:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2543
            EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2544
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2545
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2546
                createWindowInfo *cwi = (createWindowInfo *)(lParam);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2547
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2548
                if ((cwi->sequenceNr == wParam)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2549
                 && (cwi->sequenceNr != INVALIDATED_CWI)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2550
                    cwi->sequenceNr = INVALIDATED_CWI;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2551
                    cwi->infoWasRead = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2552
                    if (cwi->newWinHandle == NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2553
                        HANDLE ev;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2554
                        HANDLE hwnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2555
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2556
                        cwi->newWinHandle = hwnd = CreateWindowExW(
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2557
                                            cwi->winStyleBitsEx,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2558
                                            cwi->className,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2559
                                            cwi->windowName,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2560
                                            cwi->winStyleBits,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2561
                                            cwi->x, cwi->y,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2562
                                            cwi->dx, cwi->dy,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2563
                                            cwi->parentHandle,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2564
                                            NULL,           /* menu */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2565
                                            (HANDLE) __getHInstance(),
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2566
                                            cwi->localWindowInfo
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2567
                                           );
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2568
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2569
                        if (hwnd == NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2570
                            cwi->errCode = GetLastError();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2571
                            console_fprintf(stderr, "WinWorkstation [info]: CreateWindow failed: %d (0x%x) [%d]\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2572
                                                cwi->errCode, cwi->errCode, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2573
                        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2574
                            SETLOCALWINDOWINFOPTR(hwnd, cwi->localWindowInfo);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2575
#ifdef DEBUG /* PARANOIA */
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2576
                            if (GETLOCALWINDOWINFOPTR(hwnd) != cwi->localWindowInfo) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2577
                               console_fprintf(stderr, "lI-Error\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2578
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2579
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2580
                            SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2581
                                        /* SWP_NOOWNERZORDER |*/
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2582
                                        SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2583
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2584
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2585
                        ev = cwi->hCreateEvent;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2586
                        if (ev) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2587
                            SetEvent(ev);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2588
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2589
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2590
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2591
                    DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2592
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2593
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2594
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2595
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2596
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2597
        case WM_THREAD_DESTROYWINDOW:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2598
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2599
                HBRUSH br;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2600
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2601
                br = GetWindow_viewBgBrush(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2602
                if (br) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2603
                    SetWindow_viewBgBrush(hWnd, 0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2604
                    _DeleteBrushIfNotInCache(br, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2605
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2606
            }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2607
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2608
#ifdef CACHE_LAST_DC
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2609
            if (lastGcData && (lastGcHWIN == hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2610
                _releaseDC(lastGcData);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2611
            }
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2612
#endif
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2613
#ifdef CACHE_LAST_WM_PAINT_DC
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2614
            if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2615
                ReleaseDC(hWnd, last_wm_paint_dc);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2616
                last_wm_paint_win = last_wm_paint_dc = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2617
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2618
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2619
            if (! DestroyWindow(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2620
                DPRINTF(("DestroyWindow ERROR\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2621
            } else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2622
#ifdef COUNT_RESOURCES
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2623
                __cnt_createWindows--;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2624
                RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2625
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2626
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2627
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2628
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2629
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2630
        case WM_CREATE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2631
            {
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2632
#ifdef SETLOCALINFO_IN_CREATE /* no longer */
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2633
                localWindowInfo *lI;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2634
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2635
                CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2636
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2637
                lI = lpcs->lpCreateParams;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2638
                EVENT_PRINTF(("WM_CREATE lI=%x\n", lI));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2639
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2640
                SETLOCALWINDOWINFOPTR(hWnd, lI);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2641
# ifdef SUPERDEBUG
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2642
                if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2643
                    PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2644
                }
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2645
# endif /* SUPERDEBUG */
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2646
#endif
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2647
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2648
                *pDefault = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2649
#ifdef COUNT_RESOURCES
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2650
                __cnt_createWindows++;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2651
                RESPRINTF(("CreateWindows %d\n",__cnt_createWindows));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2652
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2653
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2654
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2655
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2656
        case WM_CLOSE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2657
            EVENT_PRINTF(("WM_CLOSE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2658
            if (! destroyWin) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2659
                // (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2660
                enqEvent(0, hWnd, WM_CLOSE, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2661
            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2662
                destroyWin = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2663
                {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2664
                    HBRUSH br;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2665
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2666
                    br = GetWindow_viewBgBrush(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2667
                    if (br) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2668
                        SetWindow_viewBgBrush(hWnd, 0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2669
                        _DeleteBrushIfNotInCache(br, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2670
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2671
                }
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2672
#ifdef CACHE_LAST_DC
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2673
                if (lastGcData && (lastGcHWIN == hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2674
                    _releaseDC(lastGcData);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2675
                }
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2676
#endif
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2677
#ifdef CACHE_LAST_WM_PAINT_DC
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2678
                if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2679
                    ReleaseDC(hWnd, last_wm_paint_dc);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2680
                    last_wm_paint_win = last_wm_paint_dc = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2681
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2682
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2683
                if (! DestroyWindow(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2684
                    DPRINTF(("DestroyWindow ERROR\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2685
                } else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2686
#ifdef COUNT_RESOURCES
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2687
                    __cnt_createWindows--;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2688
                    RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2689
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2690
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2691
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2692
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2693
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2694
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2695
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2696
        case WM_DESTROY:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2697
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2698
                char *n = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2699
                localWindowInfo *lI;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2700
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2701
                lI = GETLOCALWINDOWINFOPTR(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2702
                EVENT_PRINTF(("WM_DESTROY %x li=%x\n", hWnd, lI));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2703
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2704
#ifdef TOPWINDOWCLASS
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2705
                if (lI) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2706
                    if (lI->flag & LI_TOPWIN) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2707
                        n = (char*) malloc(200);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2708
                        GetClassName(hWnd,n,200);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2709
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2710
                    /* freeing now done in other thread */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2711
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2712
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2713
                SETLOCALWINDOWINFOPTR(hWnd, 0);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2714
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2715
#ifdef FREE_LI_IN_STX_PROCESS
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2716
                enqEvent(0, hWnd, WM_DESTROY, wParam, (int)n, (int)lI, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2717
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2718
                if (lI) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2719
                    free(lI);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2720
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2721
                enqEvent(0, hWnd, WM_DESTROY, wParam, (int)n, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2722
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2723
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2724
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2725
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2726
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2727
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2728
        case WM_GETMINMAXINFO:
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2729
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2730
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2731
            if (inMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2732
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2733
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2734
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2735
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2736
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2737
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2738
                int minW, maxW;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2739
                localWindowInfo *lI;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2740
                LPMINMAXINFO lpmmi;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2741
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2742
                lpmmi = (LPMINMAXINFO) lParam;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2743
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2744
                EVENT_PRINTF2(("WM_GETMINMAXINFO handle=%x got min: %d/%d\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2745
                            hWnd,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2746
                            lpmmi->ptMinTrackSize.x,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2747
                            lpmmi->ptMinTrackSize.y));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2748
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2749
                lI = GETLOCALWINDOWINFOPTR(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2750
                if (lI && (lI->minWidth) && (lI->maxWidth)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2751
                  lpmmi->ptMaxSize.x = lI->maxWidth;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2752
                  lpmmi->ptMaxSize.y = lI->maxHeight;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2753
                  lpmmi->ptMaxTrackSize.x = lI->maxWidth;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2754
                  lpmmi->ptMaxTrackSize.y = lI->maxHeight;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2755
                  lpmmi->ptMinTrackSize.x = lI->minWidth;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2756
                  lpmmi->ptMinTrackSize.y = lI->minHeight;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2757
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2758
                  EVENT_PRINTF3(("WM_GETMINMAXINFO handle=%x return min: %d/%d max: %d/%d\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2759
                                  hWnd,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2760
                                  lI->minWidth, lI->minHeight,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2761
                                  lI->maxWidth, lI->maxHeight));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2762
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2763
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2764
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2765
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2766
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2767
        case WM_SETCURSOR:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2768
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2769
                HCURSOR curs;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2770
                int hitCode;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2771
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2772
                hitCode = LOWORD(lParam);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2773
                if (hitCode != HTCLIENT) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2774
                    /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2775
                     * not in client area ...
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2776
                     */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2777
                    return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2778
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2779
                DDPRINTF(("WM_SETCURSOR\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2780
                curs = GetWindow_Cursor(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2781
                if (curs) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2782
                    SetCursor(curs);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2783
                    *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2784
                    return 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2785
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2786
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2787
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2788
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2789
        case WM_WINDOWPOSCHANGED:
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2790
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2791
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2792
            if (inMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2793
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2794
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2795
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2796
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2797
            if (hWnd == __rootWinSpezial) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2798
                /* can this happen ? */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2799
                *pDefault = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2800
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2801
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2802
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2803
            if (! inMove && (__currentCapture == CAPTURE_NONE)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2804
                POINT p;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2805
                HWND hWndChild,hWndTemp;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2806
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2807
                p.x = evRootX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2808
                p.y = evRootY;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2809
                ScreenToClient(hWnd, &p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2810
                hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2811
                do {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2812
                    hWndTemp = hWndChild;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2813
                    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2814
                } while ((hWndChild) && (hWndChild != hWndTemp));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2815
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2816
                if (hWndChild /*&& (hWndChild != hWnd)*/) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2817
                    if (hWndChild != __currentPointerView) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2818
                        int modifiers = getModifiers();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2819
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2820
                        if (__currentPointerView) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2821
                            if (inSizeMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2822
                                if (needDelayedMouseLeaveWindow == NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2823
                                    needDelayedMouseLeaveWindow = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2824
                                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2825
                            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2826
                                if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2827
                                    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2828
                                    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2829
                                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2830
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2831
                            __currentPointerView = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2832
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2833
                        if (inSizeMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2834
                            needDelayedMouseEnterWindow = hWndChild;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2835
                            delayedMouseEnterX = evRootX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2836
                            delayedMouseEnterY = evRootY;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2837
                        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2838
                            if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2839
                                enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2840
                                SetWindow_mouseXY(hWndChild, evRootX, evRootY);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2841
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2842
                            // SetFocus(hWndChild);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2843
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2844
                        __currentPointerView = hWndChild;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2845
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2846
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2847
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2848
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2849
            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2850
             * ignore child window messages ...
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2851
             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2852
            if (GetParent(hWnd) != NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2853
                break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2854
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2855
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2856
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2857
                WINDOWPOS *wp = (WINDOWPOS *)lParam;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2858
                RECT rct, dRect;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2859
                int x, y, w, h;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2860
                int dW, dH;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2861
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2862
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2863
                dRect.left = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2864
                dRect.top = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2865
                dRect.right = 100;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2866
                dRect.bottom = 100;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2867
                winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2868
                winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2869
                AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2870
                dW = dRect.right - dRect.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2871
                dH = dRect.bottom - dRect.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2872
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2873
                GetClientRect(hWnd, &rct);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2874
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2875
                x = rct.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2876
                y = rct.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2877
                w = rct.right - rct.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2878
                h = rct.bottom - rct.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2879
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2880
                if (__debug__) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2881
                    EVENT_PRINTF(("WM_WINDOWPOSCHANGED ["));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2882
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2883
                    if (wp->flags & SWP_NOSIZE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2884
                        EVENT_PRINTF(("NOSIZE "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2885
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2886
                    if (wp->flags & SWP_NOMOVE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2887
                        EVENT_PRINTF(("NOMOVE "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2888
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2889
                    if (wp->flags & SWP_NOZORDER) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2890
                        EVENT_PRINTF(("NOZORDER "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2891
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2892
                    if (wp->flags & SWP_NOREDRAW) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2893
                        EVENT_PRINTF(("NOREDRAW "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2894
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2895
                    if (wp->flags & SWP_NOACTIVATE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2896
                        EVENT_PRINTF(("NOACTIVATE "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2897
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2898
                    if (wp->flags & SWP_FRAMECHANGED) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2899
                        EVENT_PRINTF(("FRAMECHANGED "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2900
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2901
                    if (wp->flags & SWP_NOCOPYBITS) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2902
                        EVENT_PRINTF(("NOCOPYBITS "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2903
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2904
                    if (wp->flags & SWP_NOOWNERZORDER) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2905
                        EVENT_PRINTF(("NOOWNERZORDER "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2906
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2907
                    if (wp->flags & SWP_NOSENDCHANGING) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2908
                        EVENT_PRINTF(("NOSENDCHANGING "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2909
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2910
                    if (wp->flags & SWP_DEFERERASE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2911
                        EVENT_PRINTF(("DEFERERASE "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2912
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2913
                    if (wp->flags & SWP_ASYNCWINDOWPOS) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2914
                        EVENT_PRINTF(("ASYNCWINDOWPOS "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2915
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2916
                    if (wp->flags & SWP_HIDEWINDOW) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2917
                        EVENT_PRINTF(("HIDEWINDOW "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2918
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2919
                    if (wp->flags & SWP_SHOWWINDOW) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2920
                        EVENT_PRINTF(("SHOWWINDOW "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2921
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2922
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2923
                    EVENT_PRINTF(("] %d/%d %d/%d flags:%d (0x%x) ->",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2924
                                wp->x, wp->y, wp->cx, wp->cy, wp->flags, wp->flags));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2925
                    EVENT_PRINTF(("  client rect now: %d/%d %d/%d\n",x, y, w, h));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2926
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2927
                } /* __debug__ */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2928
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2929
                if ((w == 0) && (h == 0)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2930
                    EVENT_PRINTF(("w,h = 0.\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2931
                    if (! GetWindow_iconified(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2932
                        EVENT_PRINTF(("iconified.\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2933
                        SetWindow_iconified(hWnd, 1);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2934
                        DPRINTF(("WM_WINDOWPOSCHANGED to iconified (flags:0x%x)\n", wp->flags));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2935
                        enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2936
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2937
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2938
                    if (GetWindow_iconified(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2939
                        EVENT_PRINTF(("deiconified.\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2940
                        SetWindow_iconified(hWnd, 0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2941
                        DPRINTF(("WM_WINDOWPOSCHANGED to deiconified (flags:0x%x)\n", wp->flags));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2942
                        enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2943
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2944
                    if (!(wp->flags & SWP_NOSIZE)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2945
                     || !(wp->flags & SWP_NOMOVE)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2946
                        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
  2947
#ifdef COMPRESS_WINDOWPOSCHANGED
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2948
                        /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2949
                         * remember the current
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2950
                         * window and size;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2951
                         * This allows the backend to ignore
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2952
                         * intermediate events.
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2953
                         */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2954
                        lastPos_win = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2955
                        lastPos_w = w;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2956
                        lastPos_h = h;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2957
                        lastPos_x = x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2958
                        lastPos_y = y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2959
                        lastPos_win = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2960
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2961
                        enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2962
                    } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2963
                        EVENT_PRINTF(("no event due to SWP_NOSIZE/SWP_NOMOVE.\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2964
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2965
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2966
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2967
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2968
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2969
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2970
        case WM_ERASEBKGND:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2971
            DPRINTFIF(__debug_WM_ERASEBKGND__ , ("WM_ERASEBKGND\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2972
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2973
                NDPRINTF(("WM_ERASEBKGND for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2974
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2975
            }
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2976
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2977
#ifndef PRE_21_NOV
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2978
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2979
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2980
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2981
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2982
            if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2983
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2984
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2985
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2986
            if (hWnd == __rootWinSpezial) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2987
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2988
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2989
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2990
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2991
            /* THIS_WORKS */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2992
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2993
            return 0;
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2994
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  2995
#endif  /* ! PRE_21_NOV */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2996
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2997
        case WM_PAINT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2998
            DPRINTFIF(__debug_WM_PAINT__ , ("WM_PAINT ********************* "));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  2999
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3000
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3001
                NDPRINTF(("WM_PAINT for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3002
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3003
            }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  3004
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3005
#ifndef PRE_21_NOV
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3006
            {   int n;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3007
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3008
                n = __generateExposes( hWnd, NULL, WM_PAINT, 0 );
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3009
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3010
                if( n <= 0 ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3011
                    * pDefault = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3012
                    return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3013
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3014
                * pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3015
                return n;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3016
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3017
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3018
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3019
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3020
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3021
            if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3022
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3023
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3024
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3025
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3026
            if (hWnd == __rootWinSpezial) {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3027
# ifdef THIS_MAKES_GUI_PAINTER_START_SLOW
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3028
                *pDefault = 0;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3029
# endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3030
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3031
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3032
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3033
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3034
                int retVal;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3035
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  3036
# ifdef LATE_GENERATE_EXPOSE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3037
                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
  3038
# else
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3039
                AQUIRE_DRAW_MUTEX
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3040
                retVal = __generateExposes(hWnd, NULL, WM_PAINT, WM_PAINT_CLEAR_EARLY);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3041
                RELEASE_DRAW_MUTEX
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  3042
# endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3043
                switch (retVal) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3044
                    case -1:  /* error */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3045
                        *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3046
                        break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3047
                    case 0:   /* nothing generated */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3048
                    default:  /* generated events */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3049
                        break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3050
                }
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3051
# ifdef THIS_IS_BAD
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3052
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3053
                return 1;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3054
# endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3055
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3056
            return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3057
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  3058
#endif  /* ! PRE_21_NOV */
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3059
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3060
        case WM_SIZE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3061
            DPRINTFIF(__debug_WM_SIZE__ , ("WM_SIZE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3062
            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3063
             * ignore child window messages ...
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3064
             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3065
            if (GetParent(hWnd) != NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3066
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3067
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3068
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3069
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3070
            switch (wParam) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3071
                case SIZE_MAXIMIZED:     /* default handling */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3072
                case SIZE_MINIMIZED:     /* default handling */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3073
                case SIZE_RESTORED:      /* default handling */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3074
                    {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3075
                        RECT rct;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3076
                        int x, y, w, h;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3077
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3078
                        GetClientRect(hWnd, &rct);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3079
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3080
                        x = rct.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3081
                        y = rct.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3082
                        w = rct.right - rct.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3083
                        h = rct.bottom - rct.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3084
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3085
                        EVENT_PRINTF(("WM_MIN/MAX/RESTORED\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3086
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3087
                        if ((w == 0) && (h == 0)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3088
                            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3089
                             * iconified ...
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3090
                             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3091
                            if (! GetWindow_iconified(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3092
                                SetWindow_iconified(hWnd, 1);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3093
                                enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3094
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3095
                        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3096
                            if (GetWindow_iconified(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3097
                                SetWindow_iconified(hWnd, 0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3098
                                enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3099
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3100
                            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
  3101
#ifdef COMPRESS_WINDOWPOSCHANGED
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3102
                            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3103
                             * remember the current
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3104
                             * window and size;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3105
                             * This allows the backend to ignore
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3106
                             * intermediate events.
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3107
                             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3108
                            lastPos_win = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3109
                            lastPos_w = w;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3110
                            lastPos_h = h;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3111
                            lastPos_x = x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3112
                            lastPos_y = y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3113
                            lastPos_win = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3114
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3115
                            enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3116
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3117
                   }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3118
                   break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3119
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3120
                default:                 /* ignore */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3121
                    *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3122
                    return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3123
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3124
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3125
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3126
        case WM_DROPFILES:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3127
            DPRINTFIF(__debug_WM_DROPFILES__ , ("WM_DROPFILES\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3128
            enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3129
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3130
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3131
        case WM_SHOWWINDOW:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3132
            DPRINTFIF(__debug_WM_SHOWWINDOW__ , ("WM_SHOWWINDOW\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3133
            enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3134
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3135
                NDPRINTF(("WM_SHOWWINDOW for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3136
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3137
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3138
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3139
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3140
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3141
        case WM_MOUSEACTIVATE :
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3142
            DPRINTFIF(__debug_WM_MOUSEACTIVATE__ , ("WM_MOUSEACTIVATE h=%x parent=%x\n", hWnd, GetParent(hWnd)));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3143
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3144
            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3145
             * ignore child window messages ...
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3146
             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3147
            if (GetParent(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3148
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3149
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3150
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3151
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3152
            if ((hWnd == __rootWinSpezial) || (hWnd == GetActiveWindow())) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3153
                DDPRINTF(("NOACTIVATE (root or already)\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3154
                return MA_NOACTIVATE;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3155
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3156
            if (LOWORD(lParam) != HTCLIENT) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3157
                DDPRINTF(("ACTIVATE (not client)\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3158
                return MA_ACTIVATE;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3159
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3160
            if (__activateOnClick) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3161
                if (__ignoreButtonPressOnActivate) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3162
                    DDPRINTF(("ACTIVATE_EAT\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3163
                    /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3164
                     * windows is sooo stupid:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3165
                     * it will send me a MOTION soon after, with the
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3166
                     * to the click location, with the buttonState down.
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3167
                     * The app will interpret that as a pressed motion and
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3168
                     * do a selection (if in a textview).
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3169
                     * To prevent this, we set a flag here, that the following
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3170
                     * motion is to be suppressed.
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3171
                     * Until the mouse is released.
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3172
                     */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3173
                    __eatingMouseEvents = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3174
                    return MA_ACTIVATEANDEAT;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3175
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3176
                DDPRINTF(("ACTIVATE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3177
                return MA_ACTIVATE;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3178
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3179
            DDPRINTF(("NO_ACTIVATE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3180
            return MA_NOACTIVATE;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3181
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3182
        case WM_NCHITTEST:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3183
            EVENT_PRINTF2(("WM_NCHITTEST\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3184
            if (hWnd == __rootWinSpezial) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3185
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3186
                return HTCLIENT;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3187
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3188
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3189
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3190
        case WM_NCACTIVATE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3191
            EVENT_PRINTF(("WM_NCACTIVATE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3192
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3193
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3194
        case WM_ACTIVATE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3195
            CPRINTF(("WM_ACTIVATE %s h=%x\n", LOWORD(wParam) ? "active" : "inactive", hWnd));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3196
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3197
            switch (LOWORD(wParam)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3198
                case WA_INACTIVE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3199
                    EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3200
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3201
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3202
                case WA_ACTIVE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3203
                    EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3204
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3205
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3206
                    __generateRecursiveExposes(hWnd, WM_PAINT);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3207
#endif /* sigh */
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3208
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3209
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3210
                case WA_CLICKACTIVE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3211
                    EVENT_PRINTF2(("++ WM_ACTIVATE clkactive h=%x\n", hWnd));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3212
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3213
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3214
                default:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3215
                    EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3216
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3217
            }
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3218
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3219
#ifndef PRE_25_NOV_03
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3220
            if (__currentCapture == CAPTURE_NONE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3221
                HWND  newHWnd = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3222
                POINT newPoint;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3223
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3224
                if (LOWORD(wParam) != WA_INACTIVE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3225
                    if (MustHandleButtonEvent()) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3226
                        newPoint.x = evRootX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3227
                        newPoint.y = evRootY;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3228
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3229
                        newHWnd = WindowFromPoint (newPoint);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3230
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3231
                        if (newHWnd) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3232
                            if ( (newHWnd == hWnd) || IsChild(hWnd, newHWnd) ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3233
                                ScreenToClient (newHWnd, & newPoint);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3234
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3235
                                if ((newPoint.x < 0) || (newPoint.y < 0)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3236
                                    newHWnd = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3237
                                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3238
                            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3239
                                newHWnd = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3240
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3241
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3242
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3243
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3244
                CPRINTF(( "Old Handle: %x New Handle: %x  x:%d y:%d\n", __currentPointerView, newHWnd, newPoint.x, newPoint.y));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3245
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3246
                if (newHWnd != __currentPointerView) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3247
                    int modifiers = getModifiers();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3248
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3249
                    if (__currentPointerView) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3250
                        if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3251
                            enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3252
                            SetWindow_mouseXY(__currentPointerView, -9999, -9999);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3253
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3254
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3255
                    __currentPointerView = newHWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3256
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3257
                    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3258
                        enqEvent(EnterWindowMask, __currentPointerView, __WM_MOUSEENTER, 0, newPoint.x, newPoint.y, 0, modifiers, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3259
                        SetWindow_mouseXY(__currentPointerView, newPoint.x, newPoint.y);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3260
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3261
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3262
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3263
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3264
            enqEvent(0, hWnd, WM_ACTIVATE, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3265
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3266
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3267
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3268
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3269
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3270
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3271
        case WM_SYSCHAR:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3272
            EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3273
            goto commonChar;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3274
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  3275
#ifdef WM_UNICHAR
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3276
        /* does not work, anyway */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3277
        case WM_UNICHAR:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3278
            DPRINTFIF(__debug_WM_CHAR__ , ("WM_UNICHAR h=%x %x\n", hWnd, wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3279
            if (wParam == UNICODE_NOCHAR) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3280
                /* this is a query from windows to see if I am able to receive unicode... */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3281
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3282
                return 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3283
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3284
            goto commonChar;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3285
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3286
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3287
        case WM_CHAR:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3288
            DPRINTFIF(__debug_WM_CHAR__ , ("WM_CHAR h=%x %x\n", hWnd, wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3289
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3290
            EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3291
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3292
        commonChar:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3293
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3294
                NDPRINTF(("WM_CHAR for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3295
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3296
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3297
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3298
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3299
                HWND destWindow;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3300
                int evMask;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3301
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3302
                if (__focusFollowsMouse) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3303
                    destWindow = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3304
                    if (destWindow == 0) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3305
                        destWindow = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3306
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3307
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3308
                    destWindow = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3309
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3310
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3311
                evMask = GetWindow_eventMask(destWindow);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3312
                if (evMask & (KeyPressMask | KeyReleaseMask)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3313
                    POINT p;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3314
                    int modifiers = getModifiers();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3315
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3316
                    p.x = evRootX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3317
                    p.y = evRootY;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3318
                    ScreenToClient(destWindow, &p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3319
                    x = p.x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3320
                    y = p.y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3321
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3322
                    DPRINTFIF(__debug_WM_CHAR__ , ("key:%x modifiers: %x\n", wParam, modifiers));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3323
                    if (evMask & KeyPressMask)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3324
                        enqEvent(KeyPressMask, destWindow, WM_KEYDOWN, wParam, x, y, lParam, (modifiers | TRANSLATED_KEY), evTime);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3325
                    if (evMask & KeyReleaseMask)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3326
                        enqEvent(KeyReleaseMask, destWindow, WM_KEYUP, wParam, x, y, lParam, (modifiers | TRANSLATED_KEY), evTime);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3327
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3328
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3329
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3330
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3331
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3332
        case WM_KEYUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3333
            DPRINTFIF(__debug_WM_KEYUP__ , ("WM_KEYUP h=%x %x\n", hWnd, wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3334
            goto commonKeyUp;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3335
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3336
        case WM_SYSKEYUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3337
            DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n, wParam"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3338
        commonKeyUp:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3339
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3340
                NDPRINTF(("WM_KEYUP/WM_SYSKEYUP for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3341
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3342
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3343
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3344
                HWND destWindow;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3345
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3346
                if (__focusFollowsMouse) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3347
                    destWindow = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3348
                    if (destWindow == 0) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3349
                        destWindow = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3350
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3351
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3352
                    destWindow = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3353
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3354
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3355
                if (GetWindow_eventMask(destWindow) & KeyReleaseMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3356
                    POINT p;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3357
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3358
                    p.x = evRootX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3359
                    p.y = evRootY;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3360
                    ScreenToClient(destWindow, &p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3361
                    x = p.x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3362
                    y = p.y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3363
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3364
                    enqEvent(KeyReleaseMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3365
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3366
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3367
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3368
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3369
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3370
        case WM_SYSKEYDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3371
            DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n, wParam"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3372
            goto commonKey;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3373
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3374
        case WM_KEYDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3375
            DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN h=%x %x\n", hWnd, wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3376
        commonKey:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3377
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3378
                NDPRINTF(("WM_KEYDOWN/WM_SYSKEYDOWN for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3379
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3380
            }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3381
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3382
#ifdef EXIT_WITH_3_CTRL_Cs
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3383
            if ((msg.wParam == 'c')
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3384
             && (GetKeyState(VK_CONTROL) & 0x8000)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3385
                /* CTRL-C */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3386
                if (ctrl_c_count++ > 3)  /* for debugging */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3387
                    exit(1);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3388
            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3389
                if (msg.wParam != VK_CONTROL)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3390
                    ctrl_c_count = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3391
            }
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3392
#endif
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  3393
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3394
            if (msg.wParam == VK_ESCAPE)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3395
                /* ESCAPE */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3396
                if (escape_count++ > 3) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3397
                    __currentCapture = CAPTURE_NONE;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3398
                    ReleaseCapture();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3399
                    CPRINTF(("ReleaseCapture <ESC>\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3400
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3401
            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3402
                escape_count = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3403
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3404
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3405
            /* FALL INTO */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3406
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3407
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3408
                HWND destWindow;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3409
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3410
                if (__focusFollowsMouse) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3411
                    destWindow = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3412
                    if (destWindow == 0) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3413
                        destWindow = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3414
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3415
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3416
                    destWindow = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3417
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3418
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3419
                if (GetWindow_eventMask(destWindow) & KeyPressMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3420
                    POINT p;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3421
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3422
                    p.x = evRootX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3423
                    p.y = evRootY;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3424
                    ScreenToClient(destWindow, &p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3425
                    x = p.x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3426
                    y = p.y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3427
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3428
                    enqEvent(KeyPressMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3429
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3430
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3431
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3432
            return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3433
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3434
#ifdef WM_MOUSEWHEEL
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3435
        case WM_MOUSEWHEEL:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3436
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3437
                HWND destWindow;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3438
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3439
                if (__focusFollowsMouse) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3440
                    destWindow = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3441
                    if (destWindow == 0) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3442
                        destWindow = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3443
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3444
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3445
                    destWindow = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3446
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3447
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3448
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3449
                EVENT_PRINTF(("WM_MOUSEWHEEL h=%x wP=%x lP=%x\n", hWnd, wParam, lParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3450
                if (GetWindow_eventMask(destWindow) & KeyPressMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3451
                    POINT p;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3452
                    int delta;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3453
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3454
                    p.x = evRootX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3455
                    p.y = evRootY;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3456
                    ScreenToClient(destWindow, &p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3457
                    x = p.x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3458
                    y = p.y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3459
                    delta = evTime - lastMouseWheelTime;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3460
                    if (evTime < lastMouseWheelTime) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3461
                        delta = (0xFFFFFFFF - lastMouseWheelTime) + evTime;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3462
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3463
                    enqEvent(0, destWindow, message, wParam, x, y, lParam, getModifiers(), delta);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3464
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3465
                lastMouseWheelTime = evTime;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3466
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3467
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3468
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3469
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3470
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3471
        case WM_MOUSEMOVE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3472
            DPRINTFIF(__debug_WM_MOUSEMOVE__ , ("WM_MOUSEMOVE h=%x\n", hWnd));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3473
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3474
                NDPRINTF(("WM_MOUSEMOVE for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3475
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3476
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3477
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3478
            if (hWnd != __currentPointerView) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3479
                if (! MustHandleButtonEvent()) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3480
                    *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3481
                    return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3482
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3483
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3484
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3485
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3486
                short x, y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3487
                int modifiers = getModifiers();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3488
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3489
                x = (int)(short)LOWORD(lParam);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3490
                y = (int)(short)HIWORD(lParam);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3491
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3492
                if (__currentCapture == CAPTURE_NONE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3493
                    if (hWnd != __currentPointerView) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3494
                        HWND prevPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3495
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3496
                        prevPointerView = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3497
                        if (prevPointerView) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3498
                            if (inSizeMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3499
                                if (needDelayedMouseLeaveWindow == NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3500
                                    needDelayedMouseLeaveWindow = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3501
                                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3502
                            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3503
                                if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3504
                                    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, evTime);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3505
                                    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3506
                                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3507
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3508
                            __currentPointerView = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3509
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3510
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3511
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3512
                        if (__activateOnClick) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3513
                            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3514
                             * only send mouseEnter if the window belongs to the current
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3515
                             * active window
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3516
                             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3517
                            if (GetTopParent(prevPointerView) == GetTopParent(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3518
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3519
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3520
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3521
                        if (inSizeMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3522
                            needDelayedMouseEnterWindow = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3523
                            delayedMouseEnterX = x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3524
                            delayedMouseEnterY = y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3525
                        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3526
                            if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3527
                                enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers, evTime);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3528
                                SetWindow_mouseXY(hWnd, x, y);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3529
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3530
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3531
                        __currentPointerView = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3532
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3533
                    DDPRINTF(("MouseMove %x\n", __currentPointerView));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3534
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3535
                    CPRINTF(("MouseMove Capture %x\n", __currentPointerView));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3536
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3537
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3538
                if ((GetWindow_eventMask(__currentPointerView) & PointerMotionMask)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3539
                 || (modifiers & AnyButtonMask)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3540
                    if (! __eatingMouseEvents) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3541
                        if ((x == lastMotionX)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3542
                         && (y == lastMotionY)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3543
                         && (__currentPointerView == lastMotionWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3544
                            /* ignore */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3545
                        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3546
                            lastMotionX = x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3547
                            lastMotionY = y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3548
                            lastMotionWnd = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3549
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3550
                            if ((GetWindow_mouseX(__currentPointerView) == x)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3551
                             && (GetWindow_mouseY(__currentPointerView) == y)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3552
                            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3553
                                enqEvent(PointerMotionMask, __currentPointerView, WM_MOUSEMOVE, wParam, x, y, 0, modifiers, evTime);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3554
                                SetWindow_mouseXY(__currentPointerView, x, y);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3555
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3556
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3557
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3558
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3559
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3560
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3561
            return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3562
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3563
        case WM_LBUTTONUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3564
            curButton = Button1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3565
            goto commonButtonUp;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3566
        case WM_MBUTTONUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3567
            curButton = Button2;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3568
            goto commonButtonUp;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3569
        case WM_RBUTTONUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3570
            curButton = Button3;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3571
commonButtonUp:
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3572
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3573
                NDPRINTF(("WM_*BUTTONUP for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3574
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3575
            }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3576
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  3577
#ifndef PRE_01_APR_04
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3578
            if ((__currentPointerView != hWnd) && (__currentPointerView == (HANDLE)0)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3579
                __currentPointerView = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3580
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3581
                if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3582
                    POINT p;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3583
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3584
                    p.x = evRootX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3585
                    p.y = evRootY;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3586
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3587
                    ScreenToClient (hWnd, & p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3588
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3589
                    if ((p.x >= 0) && (p.y >= 0)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3590
                        enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, p.x, p.y, 0, getModifiers(), EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3591
                        SetWindow_mouseXY(hWnd, p.x, p.y);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3592
                    } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3593
                        __currentPointerView = (HANDLE) 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3594
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3595
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3596
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3597
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3598
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3599
            if (__currentCapture == curButton /* CAPTURE_IMPLICIT*/) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3600
                __currentCapture = CAPTURE_NONE;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3601
                ReleaseCapture();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3602
                CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3603
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3604
            EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3605
                           hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3606
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3607
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3608
            if (GetWindow_eventMask(hWnd) & ButtonReleaseMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3609
                if (__eatingMouseEvents) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3610
                    __eatingMouseEvents = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3611
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3612
                    enqEvent(ButtonReleaseMask, hWnd,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3613
                             message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3614
                             wParam, getModifiers(), evTime);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3615
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3616
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3617
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3618
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3619
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3620
        case WM_LBUTTONDBLCLK:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3621
            curButton = Button1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3622
            goto commonButtonDown;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3623
        case WM_MBUTTONDBLCLK:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3624
            curButton = Button2;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3625
            goto commonButtonDown;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3626
        case WM_RBUTTONDBLCLK:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3627
            curButton = Button3;
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
  3628
#ifdef PRE_25_AUG_2010
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3629
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3630
                 NDPRINTF(("WM_*BUTTONDBLCLK for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3631
                 return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3632
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3633
            goto commonButton;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3634
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3635
            goto commonButtonDown;
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
  3636
#endif /* PRE_25_AUG_2010 */
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
  3637
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3638
        case WM_LBUTTONDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3639
            curButton = Button1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3640
            goto commonButtonDown;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3641
        case WM_MBUTTONDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3642
            curButton = Button2;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3643
            goto commonButtonDown;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3644
        case WM_RBUTTONDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3645
            curButton = Button3;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3646
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3647
        commonButtonDown:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3648
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3649
                NDPRINTF(("WM_*BUTTONDOWN for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3650
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3651
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3652
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3653
        commonButtonWithCapture:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3654
            if (__currentCapture == CAPTURE_NONE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3655
                __currentCapture = curButton /*CAPTURE_IMPLICIT*/;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3656
                //SetFocus(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3657
                SetCapture(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3658
                CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3659
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3660
            goto commonButton;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3661
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3662
        commonButton:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3663
            EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3664
                           hWnd, LOWORD(lParam), HIWORD(lParam)));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3665
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3666
            if (GetWindow_eventMask(hWnd) & ButtonPressMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3667
                if (__eatingMouseEvents) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3668
                    __eatingMouseEvents = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3669
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3670
                    enqEvent(ButtonPressMask, hWnd,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3671
                             message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3672
                             wParam, getModifiers(), evTime);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3673
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3674
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3675
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3676
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3677
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3678
        case WM_CAPTURECHANGED:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3679
            CPRINTF(("WM_CAPTURECHANGED %x to %x\n",hWnd,lParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3680
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3681
            if ((__currentCapture != CAPTURE_NONE) && (__currentCapture != CAPTURE_EXPLICIT))
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3682
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3683
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3684
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3685
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3686
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3687
        case WM_KILLFOCUS:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3688
            CPRINTF(("WM_KILLFOCUS\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3689
            //enqEvent(0, hWnd, WM_KILLFOCUS, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3690
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3691
                NDPRINTF(("WM_KILLFOCUS for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3692
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3693
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3694
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3695
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3696
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3697
        case WM_SETFOCUS:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3698
            CPRINTF(("WM_SETFOCUS %x\n",hWnd));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3699
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3700
            //enqEvent(0,hWnd, WM_SETFOCUS, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3701
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3702
                POINT p;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3703
                HWND hWndChild,hWndTemp;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3704
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3705
                p.x = evRootX;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3706
                p.y = evRootY;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3707
                ScreenToClient(hWnd, &p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3708
                hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3709
                do {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3710
                    hWndTemp = hWndChild;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3711
                    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3712
                } while ((hWndChild) && (hWndChild != hWndTemp));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3713
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3714
                /*console_printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3715
                if (hWndChild /*&& (hWndChild != hWnd)*/) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3716
                    if (hWndChild != __currentPointerView) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3717
                        int modifiers = getModifiers();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3718
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3719
                        if (__currentPointerView) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3720
                            if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3721
                                enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3722
                                SetWindow_mouseXY(__currentPointerView, -9999, -9999);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3723
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3724
                            __currentPointerView = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3725
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3726
                        if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3727
                            enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3728
                            SetWindow_mouseXY(hWndChild, evRootX, evRootY);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3729
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3730
                        //SetFocus(hWndChild);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3731
                        __currentPointerView = hWndChild;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3732
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3733
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3734
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3735
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3736
            if (isNative) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3737
                NDPRINTF(("WM_SETFOCUS for native - default handling\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3738
                return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3739
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3740
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3741
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3742
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3743
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3744
        case WM_GETTEXT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3745
            /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3746
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3747
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3748
        case WM_GETTEXTLENGTH:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3749
            EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3750
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3751
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3752
        case WM_NCCREATE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3753
            EVENT_PRINTF(("WM_NCCREATE %x\n", message));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3754
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3755
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3756
        case WM_NCMOUSEMOVE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3757
            if (__currentCapture == CAPTURE_NONE) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3758
                if (__currentPointerView && (hWnd != __currentPointerView)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3759
                    if (inSizeMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3760
                        if (needDelayedMouseLeaveWindow == NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3761
                            needDelayedMouseLeaveWindow = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3762
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3763
                    } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3764
                        if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3765
                            enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), evTime);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3766
                            SetWindow_mouseXY(__currentPointerView, -9999, -9999);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3767
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3768
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3769
                    __currentPointerView = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3770
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3771
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3772
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3773
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3774
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3775
        case WM_PARENTNOTIFY:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3776
            EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3777
                                hWnd, lParam, LOWORD(wParam)));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3778
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3779
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3780
        case WM_NCLBUTTONDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3781
            DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCLBUTTONDOWN\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3782
            if (__shiftedLeftButtonIsLowerWindow) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3783
                /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3784
                 * with shift, this is a lower-operation
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3785
                 */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3786
                if (GetKeyState(VK_SHIFT) & 0x8000) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3787
                    SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3788
                                 SWP_NOSENDCHANGING |
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3789
                                 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3790
                    *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3791
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3792
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3793
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3794
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3795
        case WM_NCLBUTTONUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3796
            DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCLBUTTONUP\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3797
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3798
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3799
        case WM_NCRBUTTONDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3800
            DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCRBUTTONDOWN\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3801
            if (__rightButtonIsLowerWindow) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3802
                /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3803
                 * this is a lower-operation
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3804
                 */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3805
                SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3806
                             SWP_NOSENDCHANGING |
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3807
                             SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3808
                *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3809
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3810
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3811
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3812
        case WM_NCRBUTTONUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3813
            DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCRBUTTONUP\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3814
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3815
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3816
        case WM_NCMBUTTONDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3817
            DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCMBUTTONDOWN\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3818
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3819
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3820
        case WM_NCMBUTTONUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3821
            DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCMBUTTONUP\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3822
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3823
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3824
        case WM_NCLBUTTONDBLCLK:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3825
            EVENT_PRINTF(("WM_NCLBUTTONDBLCLK\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3826
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3827
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3828
        case WM_NCRBUTTONDBLCLK:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3829
            EVENT_PRINTF(("WM_NCRBUTTONDBLCLK\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3830
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3831
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3832
        case WM_NCMBUTTONDBLCLK:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3833
            EVENT_PRINTF(("WM_NCMBUTTONDBLCLK\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3834
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3835
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3836
        case WM_SETTEXT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3837
            DPRINTFIF(__debug_WM_SETTEXT__ , ("WM_SETTEXT\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3838
            break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3839
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3840
#ifdef WM_SYNCPAINT
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3841
        case WM_SYNCPAINT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3842
            EVENT_PRINTF(("WM_SYNCPAINT\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3843
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3844
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3845
        case 0x88:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3846
            EVENT_PRINTF(("0x88 (undoc)\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3847
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3848
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3849
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3850
        case WM_NCCALCSIZE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3851
            EVENT_PRINTF(("WM_NCCALCSIZE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3852
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3853
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3854
        case WM_NCPAINT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3855
            EVENT_PRINTF3(("WM_NCPAINT\n"));
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3856
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3857
#ifdef THIS_DOES_NOT_WORK
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3858
            /* mhmh - something is drawn, but clipped wrong
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3859
             * and with wrong colors ....
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3860
             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3861
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3862
            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3863
             * child windows only ...
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3864
             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3865
            if (GetParent(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3866
                int clr;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3867
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3868
                clr = GetWindow_bdColor(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3869
                if (clr != BlackPixel) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3870
                    /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3871
                     * draw it here
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3872
                     */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3873
                    HBRUSH br;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3874
                    RECT rect, lineRect;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3875
                    HDC hDC;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3876
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3877
                    if (clr == WhitePixel) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3878
                        br = __whiteBrush;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3879
                    } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3880
                        br = CreateSolidBrush(clr);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3881
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3882
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3883
                    GetWindowRect(hWnd, &rect);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3884
                    hDC = GetWindowDC(hWnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3885
                    SelectClipRgn(hDC, NULL);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3886
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3887
                    lineRect.left = rect.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3888
                    lineRect.right = rect.right;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3889
                    lineRect.top = rect.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3890
                    lineRect.bottom = rect.top + 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3891
                    FillRect(hDC, &lineRect, br);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3892
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3893
                    lineRect.bottom = rect.bottom - 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3894
                    lineRect.bottom = rect.bottom;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3895
                    FillRect(hDC, &lineRect, br);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3896
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3897
                    lineRect.top = rect.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3898
                    lineRect.bottom = rect.bottom;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3899
                    lineRect.left = rect.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3900
                    lineRect.right = rect.left + 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3901
                    FillRect(hDC, &lineRect, br);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3902
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3903
                    lineRect.left = rect.right - 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3904
                    lineRect.right = rect.right;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3905
                    FillRect(hDC, &lineRect, br);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3906
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3907
                    _DeleteBrush(br, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3908
                    ReleaseDC(hWnd, hDC);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3909
                    *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3910
                    return 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3911
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3912
            }
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3913
#endif /* THIS_DOES_NOT_WORK */
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3914
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3915
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3916
        case WM_SYSCOMMAND:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3917
            switch (wParam & ~0x000F) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3918
                case SC_CLOSE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3919
                    EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3920
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3921
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3922
                case SC_MOVE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3923
                    EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3924
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3925
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3926
                case SC_RESTORE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3927
                    EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3928
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3929
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3930
                case SC_SIZE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3931
                    EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3932
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3933
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3934
                default:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3935
                    EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3936
                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3937
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3938
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3939
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3940
        case WM_INITMENU:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3941
            EVENT_PRINTF(("WM_INITMENU\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3942
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3943
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3944
        case WM_INITMENUPOPUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3945
            EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3946
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3947
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3948
        case WM_ENTERIDLE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3949
            EVENT_PRINTF(("WM_ENTERIDLE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3950
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3951
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3952
        case WM_ENTERMENULOOP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3953
            EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3954
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3956
        case WM_EXITMENULOOP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3957
            EVENT_PRINTF(("WM_EXITMENULOOP\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3958
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3959
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3960
        case WM_MENUSELECT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3961
            EVENT_PRINTF(("WM_MENUSELECT\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3962
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3963
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3964
        case WM_QUIT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3965
            DPRINTF(("quit message hWnd=0x%x lP=0x%x wP=0x%x\n", hWnd, lParam, wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3966
            enqEvent(0, 0, WM_QUIT, wParam, lParam, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3967
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3968
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3969
        case WM_NCDESTROY:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3970
            EVENT_PRINTF(("WM_NCDESTROY\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3971
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3972
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3973
        case WM_QUERYNEWPALETTE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3974
            EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3975
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3976
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3977
        case WM_PALETTECHANGED:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3978
            EVENT_PRINTF(("WM_PALETTECHANGED\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3979
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3980
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3981
        case WM_ACTIVATEAPP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3982
            EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3983
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3984
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3985
        case WM_SYSDEADCHAR:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3986
            EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3987
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3988
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3989
        case WM_DEADCHAR:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3990
            EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3991
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3992
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3993
        case WM_PAINTICON:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3994
            EVENT_PRINTF(("WM_PAINTICON\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3995
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3996
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3997
        case WM_ICONERASEBKGND:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3998
            EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  3999
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4000
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4001
        case WM_WINDOWPOSCHANGING:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4002
            DPRINTFIF(__debug_WM_WINDOWPOSCHANGING__ , ("WM_WINDOWPOSCHANGING\n"));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4003
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4004
#ifdef HANDLE_VIEWGRAVITY
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4005
            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4006
             * any child with a viewGravity ?
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4007
             * (only care for topViews here;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4008
             *  child views do it on the smalltalk level ...)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4009
             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4010
            if (GetParent(hWnd) == 0) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4011
                if (GetParent(hWnd) == 0) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4012
                    struct gravityCallBackInfo i;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4013
                    RECT rct, dRect;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4014
                    int dW, dH;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4015
                    WINDOWPOS *wp = (WINDOWPOS *)lParam;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4016
                    int winStyleBits, winExStyleBits;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4017
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4018
                    if (! (wp->flags & SWP_NOSIZE)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4019
                        dRect.left = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4020
                        dRect.top = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4021
                        dRect.right = 100;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4022
                        dRect.bottom = 100;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4023
                        winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4024
                        winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4025
                        AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4026
                        dW = dRect.right - dRect.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4027
                        dH = dRect.bottom - dRect.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4028
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4029
                        GetClientRect(hWnd, &rct);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4030
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4031
                        i.parent = hWnd;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4032
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4033
                        i.currW = rct.right - rct.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4034
                        i.currH = rct.bottom - rct.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4035
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4036
                        /* wp gives us the new outer (frame) bounds */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4037
                        i.newW = wp->cx - (dW - 100);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4038
                        i.newH = wp->cy - (dH - 100);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4039
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4040
                        if ((i.currW != i.newW)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4041
                         || (i.currH != i.newH)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4042
                            DPRINTF((stderr, "about to sizeChange old: %d/%d new: %d/%d\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4043
                                    i.currW, i.currH, i.newW, i.newH));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4044
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4045
                            GetWindowRect(hWnd, &rct);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4046
                            i.parentWinX = rct.left - dRect.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4047
                            i.parentWinY = rct.top - dRect.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4048
                            EnumChildWindows(hWnd, gravityEnumeratorCallBack, (int)(&i));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4049
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4050
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4051
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4052
            }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4053
#endif /* HANDLE_VIEWGRAVITY */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4054
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4055
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4056
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4057
        case WM_QUERYOPEN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4058
            EVENT_PRINTF(("WM_QUERYOPEN\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4059
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4060
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4061
        case WM_QUERYENDSESSION:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4062
            EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4063
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4064
            if (@global(CanEndSession) == false) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4065
                enqEvent(0, hWnd, WM_QUERYENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4066
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4067
                // TODO: enter new event loop
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4068
                // which is left when an endSessionConfirmation
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4069
                // arrives from smalltalk
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4070
                // (either positive or negative).
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4071
                // for now, do not allow leaving
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4072
                // windows as long as ST/X is open.
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4073
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4074
                return(0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4075
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4076
            return(TRUE);  // allow leaving windows
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4077
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4078
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4079
        case WM_ENDSESSION:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4080
            EVENT_PRINTF(("WM_ENDSESSION\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4081
            enqEvent(0, hWnd, WM_ENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4082
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4083
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4084
        case WM_DISPLAYCHANGE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4085
            EVENT_PRINTF(("WM_DISPLAYCHANGE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4086
            enqEvent(0, hWnd, WM_DISPLAYCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4087
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4088
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4089
        case WM_FONTCHANGE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4090
            EVENT_PRINTF(("WM_FONTCHANGE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4091
            enqEvent(0, hWnd, WM_FONTCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4092
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4093
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4094
        case WM_WININICHANGE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4095
            EVENT_PRINTF(("WM_WININICHANGE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4096
            enqEvent(0, hWnd, WM_WININICHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4097
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4098
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4099
        case WM_SYSCOLORCHANGE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4100
            EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4101
            enqEvent(0, hWnd, WM_SYSCOLORCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4102
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4103
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4104
        case WM_MOVING:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4105
            DPRINTFIF(__debug_WM_MOVING__ , ("WM_MOVING\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4106
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4107
            inMove = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4108
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4109
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4110
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4111
        case WM_SIZING:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4112
            EVENT_PRINTF(("WM_SIZING\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4113
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4114
            inSize = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4115
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4116
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4117
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4118
        case WM_ENTERSIZEMOVE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4119
            EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4120
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4121
            inSizeMove = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4122
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4123
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4124
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4125
        case WM_EXITSIZEMOVE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4126
            EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  4127
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  4128
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4129
            if (inMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4130
                /* generate WM_WINDOWPOSCHANGED
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4131
                */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4132
                RECT rct;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4133
                int x, y, w, h;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4134
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4135
                GetClientRect(hWnd, &rct);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4136
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4137
                x = rct.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4138
                y = rct.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4139
                w = rct.right - rct.left;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4140
                h = rct.bottom - rct.top;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4141
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4142
                if ((w == 0) && (h == 0)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4143
                    if (! GetWindow_iconified(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4144
                        SetWindow_iconified(hWnd, 1);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4145
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4146
                    enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4147
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4148
                    if (GetWindow_iconified(hWnd)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4149
                        SetWindow_iconified(hWnd, 0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4150
                        enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4151
                    } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4152
                        enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4153
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4154
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4155
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4156
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4157
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4158
            inSizeMove = inMove = inSize = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4159
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4160
            if (needDelayedMouseLeaveWindow || needDelayedMouseEnterWindow) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4161
                int modifiers = getModifiers();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4162
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4163
                if (needDelayedMouseLeaveWindow) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4164
                    if (GetWindow_eventMask(needDelayedMouseLeaveWindow) & LeaveWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4165
                        enqEvent(LeaveWindowMask, needDelayedMouseLeaveWindow, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4166
                        SetWindow_mouseXY(needDelayedMouseLeaveWindow, -9999, -9999);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4167
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4168
                    needDelayedMouseLeaveWindow = NULL;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4169
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4170
                if (needDelayedMouseEnterWindow) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4171
                    if (GetWindow_eventMask(needDelayedMouseEnterWindow) & EnterWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4172
                        enqEvent(EnterWindowMask, needDelayedMouseEnterWindow, __WM_MOUSEENTER, 0, delayedMouseEnterX, delayedMouseEnterY, 0, modifiers, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4173
                        SetWindow_mouseXY(needDelayedMouseEnterWindow, delayedMouseEnterX, delayedMouseEnterY);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4174
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4175
                    needDelayedMouseEnterWindow = NULL;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4176
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4177
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4178
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4179
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4180
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4181
        case WM_MOVE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4182
            EVENT_PRINTF(("WM_MOVE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4183
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4184
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4185
        case WM_POWER:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4186
            EVENT_PRINTF(("WM_POWER\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4187
            enqEvent(0, hWnd, WM_POWER, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4188
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4189
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4190
        /* native widget actions */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4191
        case WM_COMMAND:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4192
            if (lParam) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4193
                NDPRINTF(("COMMAND for widget\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4194
                enqEvent(0, (HWND)(lParam), WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4195
            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4196
                NDPRINTF(("COMMAND for owner\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4197
                enqEvent(0, hWnd, WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4198
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4199
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4200
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4201
        /* tray action */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4202
        case WM_TRAY_MESSAGE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4203
            DPRINTF(("tray message hWnd=0x%x lP=0x%x wP=0x%x\n", hWnd, lParam, wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4204
            enqEvent(0, hWnd, WM_TRAY_MESSAGE, wParam, lParam, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4205
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4206
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4207
        case WM_COPYDATA:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4208
            DPRINTFIF(__debug_WM_COPYDATA__ , ("WM_COPYDATA\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4209
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4210
                PCOPYDATASTRUCT pCDs;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4211
                int dwData;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4212
                void *pData;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4213
                void *pCopiedData;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4214
                int nBytes;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4215
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4216
                pCDs = (PCOPYDATASTRUCT) lParam;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4217
                dwData = pCDs->dwData;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4218
                nBytes = pCDs->cbData;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4219
                pData = (void *)pCDs->lpData;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4220
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4221
                /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4222
                 * because pData is only valid here, copy it out to a malloc'd
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4223
                 * area. This MUST be free'd by someone else !
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4224
                 */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4225
                if (nBytes) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4226
                    pCopiedData = malloc(nBytes);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4227
                    memcpy(pCopiedData, pData, nBytes);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4228
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4229
                    pCopiedData = NULL;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4230
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4231
                //     (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4232
                enqEvent(0, hWnd, WM_COPYDATA, wParam, (int)pCopiedData, nBytes, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4233
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4234
            *pDefault = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4235
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4236
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4237
        case WM_HSCROLL:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4238
        case WM_VSCROLL:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4239
            NDPRINTF(("VM_*SCROLL\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4240
            enqEvent(0, hWnd, message, wParam, lParam, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4241
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4242
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4243
        case WM_DRAWITEM:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4244
            EVENT_PRINTF(("WM_DRAWITEM\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4245
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4246
            {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4247
                DRAWITEMSTRUCT *pItemStruct;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4248
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4249
                pItemStruct = (DRAWITEMSTRUCT *)lParam;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4250
                enqEvent(0, pItemStruct->hwndItem, WM_DRAWITEM, wParam, 0, 0, 0, 0, EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4251
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4252
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4253
            break;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  4254
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  4255
#ifdef TRACE_ALL_EVENTS
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4256
        case WM_CTLCOLORMSGBOX:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4257
            UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORMSGBOX\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4258
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4259
        case WM_CTLCOLOREDIT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4260
            UNHANDLED_EVENT_PRINTF(("WM_CTLCOLOREDIT\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4261
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4262
        case WM_CTLCOLORLISTBOX:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4263
            UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORLISTBOX\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4264
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4265
        case WM_CTLCOLORBTN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4266
            UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORBTN\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4267
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4268
        case WM_CTLCOLORDLG:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4269
            UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORDLG\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4270
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4271
        case WM_CTLCOLORSTATIC:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4272
            UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORSTATIC\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4273
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4274
        case WM_CTLCOLORSCROLLBAR:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4275
            UNHANDLED_EVENT_PRINTFIF(__debug_WM_CTLCOLORSCROLLBAR__, ("WM_CTLCOLORSCROLLBAR\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4276
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4277
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4278
        case WM_STYLECHANGING:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4279
            UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4280
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4281
        case WM_STYLECHANGED:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4282
            UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4283
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4284
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4285
        case WM_GETICON:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4286
            UNHANDLED_EVENT_PRINTFIF(__debug_WM_GETICON__, ("WM_GETICON\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4287
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4288
        case WM_SETICON:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4289
            UNHANDLED_EVENT_PRINTF(("WM_SETICON\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4290
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4291
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4292
        case WM_PRINT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4293
            UNHANDLED_EVENT_PRINTF(("WM_PRINT(lParam=%d)\n", lParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4294
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4295
        case WM_PRINTCLIENT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4296
            UNHANDLED_EVENT_PRINTF(("WM_PRINTCLIENT(lParam=%d)\n", lParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4297
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4298
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4299
        case WM_NULL:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4300
            UNHANDLED_EVENT_PRINTF(("WM_NULL\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4301
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4302
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4303
        case WM_ENABLE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4304
            UNHANDLED_EVENT_PRINTF(("WM_ENABLE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4305
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4306
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4307
        case WM_SETREDRAW:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4308
            UNHANDLED_EVENT_PRINTF(("WM_SETREDRAW\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4309
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4310
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4311
        case WM_DEVMODECHANGE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4312
            UNHANDLED_EVENT_PRINTF(("WM_DEVMODECHANGE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4313
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4314
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4315
        case WM_TIMECHANGE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4316
            UNHANDLED_EVENT_PRINTF(("WM_TIMECHANGE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4317
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4318
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4319
        case WM_CANCELMODE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4320
            UNHANDLED_EVENT_PRINTF(("WM_CANCELMODE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4321
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4322
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4323
        case WM_CHILDACTIVATE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4324
            UNHANDLED_EVENT_PRINTF(("WM_CHILDACTIVATE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4325
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4326
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4327
        case WM_QUEUESYNC:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4328
            UNHANDLED_EVENT_PRINTF(("WM_QUEUESYNC\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4329
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4330
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4331
        case WM_NEXTDLGCTL:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4332
            UNHANDLED_EVENT_PRINTF(("WM_NEXTDLGCTL\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4333
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4334
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4335
        case WM_SPOOLERSTATUS:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4336
            UNHANDLED_EVENT_PRINTF(("WM_SPOOLERSTATUS\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4337
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4338
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4339
        case WM_MEASUREITEM:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4340
            UNHANDLED_EVENT_PRINTF(("WM_MEASUREITEM\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4341
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4342
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4343
        case WM_DELETEITEM:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4344
            UNHANDLED_EVENT_PRINTF(("WM_DELETEITEM\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4345
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4346
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4347
        case WM_VKEYTOITEM:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4348
            UNHANDLED_EVENT_PRINTF(("WM_VKEYTOITEM\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4349
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4350
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4351
        case WM_CHARTOITEM:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4352
            UNHANDLED_EVENT_PRINTF(("WM_CHARTOITEM\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4353
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4354
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4355
        case WM_SETFONT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4356
            UNHANDLED_EVENT_PRINTF(("WM_SETFONT\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4357
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4358
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4359
        case WM_GETFONT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4360
            UNHANDLED_EVENT_PRINTF(("WM_GETFONT\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4361
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4362
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4363
        case WM_SETHOTKEY:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4364
            UNHANDLED_EVENT_PRINTF(("WM_SETHOTKEY\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4365
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4366
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4367
        case WM_GETHOTKEY:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4368
            UNHANDLED_EVENT_PRINTF(("WM_GETHOTKEY\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4369
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4370
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4371
        case WM_QUERYDRAGICON:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4372
            UNHANDLED_EVENT_PRINTF(("WM_QUERYDRAGICON\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4373
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4374
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4375
        case WM_COMPAREITEM:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4376
            UNHANDLED_EVENT_PRINTF(("WM_COMPAREITEM\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4377
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4378
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4379
        case WM_GETOBJECT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4380
            UNHANDLED_EVENT_PRINTF(("WM_GETOBJECT\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4381
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4382
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4383
        case WM_COMPACTING:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4384
            UNHANDLED_EVENT_PRINTF(("WM_COMPACTING\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4385
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4386
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4387
        case WM_COMMNOTIFY:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4388
            UNHANDLED_EVENT_PRINTF(("WM_COMMNOTIFY\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4389
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4390
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4391
        case WM_CANCELJOURNAL:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4392
            UNHANDLED_EVENT_PRINTF(("WM_CANCELJOURNAL\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4393
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4394
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4395
        case WM_INPUTLANGCHANGEREQUEST:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4396
            UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGEREQUEST\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4397
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4398
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4399
        case WM_INPUTLANGCHANGE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4400
            UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4401
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4402
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4403
        case WM_TCARD:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4404
            UNHANDLED_EVENT_PRINTF(("WM_TCARD\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4405
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4406
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4407
        case WM_HELP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4408
            UNHANDLED_EVENT_PRINTF(("WM_HELP\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4409
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4410
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4411
        case WM_USERCHANGED:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4412
            UNHANDLED_EVENT_PRINTF(("WM_USERCHANGED\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4413
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4414
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4415
        case WM_NOTIFY:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4416
            UNHANDLED_EVENT_PRINTF(("WM_NOTIFY\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4417
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4418
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4419
        case WM_NOTIFYFORMAT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4420
            UNHANDLED_EVENT_PRINTF(("WM_NOTIFYFORMAT\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4421
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4422
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4423
        case WM_CONTEXTMENU:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4424
            UNHANDLED_EVENT_PRINTF(("WM_CONTEXTMENU\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4425
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4426
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4427
        case WM_NCXBUTTONDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4428
            UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDOWN\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4429
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4430
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4431
        case WM_NCXBUTTONUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4432
            UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONUP\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4433
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4434
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4435
        case WM_NCXBUTTONDBLCLK:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4436
            UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDBLCLK\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4437
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4438
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4439
        case WM_DEVICECHANGE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4440
            UNHANDLED_EVENT_PRINTF(("WM_DEVICECHANGE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4441
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4442
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4443
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4444
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4445
        default:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4446
            EVENT_PRINTF(( "WinWorkstat [info] unhandled msg = %d 0x%x [%d]\n", message, message, __LINE__));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4447
            break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4448
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4449
    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4450
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4451
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4452
LONG APIENTRY
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4453
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4454
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4455
static void _USERENTRY
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4456
dispatchThread(void *arg)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4457
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4458
    static int th_calls;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4459
    RECT rect;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4460
    MSG msg;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4461
    localWindowInfo *lI;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4462
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4463
    _dispatchThreadId2 = GetCurrentThreadId();
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4464
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  4465
    console_fprintf(stderr, "WinWorkstation [info]: dispatchThreadID2=%x\n", _dispatchThreadId2);
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4466
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4467
    TH_DPRINTF(("TS %d\n", th_calls++));
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4468
    PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE);   /* must be */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4469
4444
8d6a48c51edc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  4470
#if 0
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4471
    if (AttachThreadInput(_masterThreadId, _dispatchThreadId2, TRUE) != TRUE) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4472
        console_fprintf(stderr, "WinWorkstation [warning]: AttachThreadInput failed\n");
4443
96e956cf9acf plugin stuff now in librun
Claus Gittinger <cg@exept.de>
parents: 4441
diff changeset
  4473
    };
4444
8d6a48c51edc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  4474
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4475
#ifndef WIN32THREADS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4476
# if 0
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4477
    SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4478
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4479
# endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4480
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4481
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4482
    GetWindowRect(GetDesktopWindow(), &rect);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4483
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4484
    lI = (localWindowInfo *)malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4485
    if (lI) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4486
        memset(lI, 0, sizeof(*lI));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4487
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4488
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4489
    __rootWinSpezial = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT,
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4490
                                      wapp_nameRoot, wapp_nameRoot,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4491
                                      WS_POPUP | WS_DISABLED,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4492
                                      0, 0,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4493
                                      rect.right - rect.left, rect.bottom - rect.top,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4494
                                      0, 0, (HANDLE) __getHInstance(), lI);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4495
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  4496
    //ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  4497
    SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4498
                 SWP_NOSENDCHANGING |
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4499
                 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4500
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4501
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  4502
    console_fprintf(stderr, "WinWorkstation [info]: setting ThreadRunningEvent\n");
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4503
#endif
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4504
    SetEvent(hDispatchThreadRunningEvent);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4505
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4506
    for (;;) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4507
        HANDLE dummy;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4508
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4509
        TH_DPRINTF(("TG %d\n", th_calls++));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4510
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4511
        /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4512
         * if there is no current capture (pointer-grab),
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4513
         * make certain that we do not get stuck in the GetMessage
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4514
         * but instead poll the mouse in 200ms intervals.
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4515
         * This is required to synthesize the MOUSELEAVE message,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4516
         */
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4517
// DPRINTF(("X1\n"));
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4518
        if (__currentPointerView && (__currentCapture == CAPTURE_NONE)) {
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4519
// DPRINTF(("X2\n"));
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4520
            while (PeekMessageW(&msg, 0, 0, 0, PM_NOREMOVE) == 0) {
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4521
// DPRINTF(("PeekMessage -> 0\n"));
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4522
                /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4523
                 * wait for an event; timeout after 200 millis
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4524
                 */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4525
                if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4526
                    if (! inSizeMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4527
                        /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4528
                         * timeout - see where mouse pointer is
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4529
                         * for synthetic leave events.
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4530
                         */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4531
                        POINT point;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4532
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4533
                        if (GetCursorPos(&point)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4534
                            HWND hWnd = WindowFromPoint(point);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4535
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4536
                            if (hWnd) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4537
                                if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId()) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4538
                                    if (inSizeMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4539
                                        if (needDelayedMouseLeaveWindow == NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4540
                                            needDelayedMouseLeaveWindow = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4541
                                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4542
                                    } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4543
                                        if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4544
                                            enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4545
                                            SetWindow_mouseXY(__currentPointerView, -9999, -9999);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4546
                                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4547
                                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4548
                                    __currentPointerView = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4549
                                    break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4550
                                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4551
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4552
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4553
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4554
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4555
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4556
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4557
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4558
        GetMessageW(&msg, NULL, 0, 0);
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4559
// DPRINTF(("GetMessage -> %d\n", msg.message));
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4560
        TH_DPRINTF(("TD %d\n", th_calls++));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4561
        destroyWin = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4562
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4563
        switch (msg.message) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4564
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4565
            case WM_THREAD_DESTROYWINDOW:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4566
                destroyWin = TRUE;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4567
                msg.message = WM_CLOSE;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4568
                EVENT_PRINTF(("thread WM_THREAD_DESTROYWINDOW %x\n",msg.hwnd));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4569
                break;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4570
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4571
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4572
#ifdef SET_FOCUS_IN_WINTHREAD
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4573
            case WM_THREAD_SETFOCUS:
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4574
# ifdef xxWIN32THREADS
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4575
                if (msg.lParam) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4576
                    if (AttachThreadInput(_dispatchThreadId2,msg.lParam,TRUE) == FALSE)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4577
                        PRINTF(("SetFocus AttachThreadInput error %d\n", GetLastError()));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4578
                }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4579
# endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4580
                EVENT_PRINTF(("threadSetfocus %x\n",msg.wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4581
                if (SetFocus((HWND)msg.wParam) == 0) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4582
                    DDPRINTF(("SetFocus to %x failed.\n",msg.wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4583
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4584
                continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4585
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4586
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4587
#ifdef SET_CURSOR_IN_WINTHREAD
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4588
            case WM_THREAD_SETCURSOR:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4589
                if (msg.lParam) {
5517
3581c9a93da6 Remove obsolete win95 stuff
Stefan Vogel <sv@exept.de>
parents: 5515
diff changeset
  4590
#if 1
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4591
                    SetCursor((HCURSOR)msg.lParam);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4592
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4593
                    /* this check is done by our sender */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4594
                    {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4595
                        POINT p;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4596
                        GetCursorPos(&p);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4597
                        if (WindowFromPoint(p) == msg.hwnd) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4598
                            EVENT_PRINTF(("threadSetCursor %x\n",msg.lParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4599
                            SetCursor((HCURSOR)msg.lParam);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4600
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4601
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4602
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4603
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4604
                continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4605
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4606
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4607
#ifdef BEEP_IN_WINTHREAD
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4608
            case WM_THREAD_BEEP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4609
                MessageBeep( MB_ICONEXCLAMATION);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4610
                continue;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4611
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4612
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4613
            case WM_THREAD_SETCAPTURE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4614
                if (msg.wParam) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4615
                    if (__currentPointerView) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4616
                        if (inSizeMove) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4617
                            if (needDelayedMouseLeaveWindow == NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4618
                                needDelayedMouseLeaveWindow = __currentPointerView;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4619
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4620
                        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4621
                            if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4622
                                enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4623
                                SetWindow_mouseXY(__currentPointerView, -9999, -9999);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4624
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4625
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4626
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4627
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4628
                    __currentPointerView = (HWND)msg.wParam;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4629
                    __currentCapture = CAPTURE_EXPLICIT;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4630
                    EVENT_PRINTF(("threadSetCapture %x\n",msg.wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4631
                    SetCapture(__currentPointerView);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4632
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4633
                    if (__currentPointerView  == __rootWinSpezial) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4634
                        //ShowWindow(__rootWinSpezial, SW_HIDE);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4635
                        SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4636
                                     SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4637
                                     | SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4638
                                   /*| SWP_NOZORDER | SWP_NOOWNERZORDER */);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4639
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4640
                    __currentPointerView = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4641
                    __currentCapture = CAPTURE_NONE;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4642
                    EVENT_PRINTF(("threadReleaseCapture\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4643
                    ReleaseCapture();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4644
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4645
                if (msg.lParam) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4646
                    DDPRINTF(("threadSetCursor %x\n",msg.lParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4647
                    SetCursor((HCURSOR)msg.lParam);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4648
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4649
                continue;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4650
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4651
            case WM_THREAD_CREATEWINDOW:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4652
                EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW %d\n", th_calls));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4653
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4654
                {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4655
                    createWindowInfo *cwi = (createWindowInfo *)(msg.lParam);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4656
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4657
                    if ((cwi->sequenceNr == msg.wParam)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4658
                     && (cwi->sequenceNr != INVALIDATED_CWI)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4659
                        cwi->sequenceNr = INVALIDATED_CWI;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4660
                        cwi->infoWasRead = 1;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4661
                        if (cwi->newWinHandle == NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4662
                            HANDLE ev;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4663
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4664
                            cwi->newWinHandle = CreateWindowExW(
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4665
                                                cwi->winStyleBitsEx,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4666
                                                cwi->className,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4667
                                                cwi->windowName,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4668
                                                cwi->winStyleBits,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4669
                                                cwi->x, cwi->y,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4670
                                                cwi->dx, cwi->dy,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4671
                                                cwi->parentHandle,
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4672
                                                NULL,           /* menu */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4673
                                                (HANDLE) __getHInstance(),
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4674
                                                cwi->localWindowInfo
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4675
                                               );
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4676
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4677
                            if (cwi->newWinHandle == NULL) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4678
                                cwi->errCode = GetLastError();
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4679
                                console_fprintf(stderr, "WinWorkstation [info]: CreateWindow %s failed: %d (0x%x) [%d]\n",
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4680
                                                cwi->className, cwi->errCode, cwi->errCode, __LINE__);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4681
                            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4682
                                SETLOCALWINDOWINFOPTR(cwi->newWinHandle, cwi->localWindowInfo);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  4683
#ifdef DEBUG /* PARANOIA */
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4684
                                if (GETLOCALWINDOWINFOPTR(cwi->newWinHandle) != cwi->localWindowInfo) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4685
                                   console_fprintf(stderr, "lI-Error\n");
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4686
                                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4687
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4688
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4689
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4690
                            ev = cwi->hCreateEvent;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4691
                            if (ev) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4692
                                SetEvent(ev);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4693
                            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4694
                        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4695
                    } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4696
                        DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4697
                    }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4698
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4699
                continue;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4700
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4701
            case WM_KEYDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4702
                DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN %x\n", msg.wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4703
                goto commonKey;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4704
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4705
            case WM_KEYUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4706
                DPRINTFIF(__debug_WM_KEYUP__  , ("WM_KEYUP %x\n", msg.wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4707
                goto commonKey;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4708
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4709
            case WM_SYSKEYDOWN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4710
                DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n", msg.wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4711
                goto commonKey;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4712
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4713
            case WM_SYSKEYUP:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4714
                DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n", msg.wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4715
                goto commonKey;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4716
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4717
            case WM_HOTKEY:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4718
                DPRINTFIF(__debug_WM_KEYUP__ , ("WM_HOTKEY %x\n", msg.wParam));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4719
                goto commonKey;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4720
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4721
            commonKey:
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
  4722
#if 1
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4723
                if (((msg.wParam >= '0') && (msg.wParam <= 'Z'))
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4724
                 || ((msg.wParam >= VK_MULTIPLY) && (msg.wParam <= VK_DIVIDE))
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4725
                 || (msg.wParam == VK_SPACE)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4726
                 || (msg.wParam == VK_CAPITAL)
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4727
                 /* || (msg.wParam == VK_SHIFT) */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4728
                 || (msg.wParam >= 0xB0))
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4729
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4730
                {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4731
                    /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4732
                     * translate to a WM_CHAR message
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4733
                     */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4734
                    if (TranslateMessage(&msg))
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4735
                        continue;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4736
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4737
                break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4738
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4739
            /* short cirquit some messages */
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  4740
#if 0
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4741
#ifndef SUPPORT_NATIVE_WINDOWS
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4742
            /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4743
             * some can simply be ignored ...
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4744
             */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4745
            case WM_ERASEBKGND:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4746
                EVENT_PRINTF(("*WM_ERASEBKGND\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4747
                continue;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4748
            case WM_KILLFOCUS:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4749
                EVENT_PRINTF(("*WM_KILLFOCUS\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4750
                continue;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4751
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4752
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4753
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4754
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4755
            case WM_SIZE:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4756
                EVENT_PRINTF(("*WM_SIZE\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4757
                continue;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4758
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4759
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4760
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4761
        /*
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4762
         * common ...
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4763
         */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4764
        evRootX = msg.pt.x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4765
        evRootY = msg.pt.y;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4766
#if 1
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4767
        {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4768
            POINT p;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4769
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4770
            if (GetCursorPos(&p)) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4771
                evRootX = p.x;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4772
                evRootY = p.y;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4773
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4774
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4775
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4776
        lastMSGTime = msg.time;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4777
        DispatchMessageW(&msg);   /* Dispatches message to window */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4778
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4779
}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4780
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4781
LONG APIENTRY
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4782
MainWndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4783
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4784
    int wantDefault = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4785
    int retVal;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4786
    createWindowInfo *cwi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4787
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4788
    TH_DPRINTF(("TMW %d\n",message));
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4789
    EVENT_PRINTF3(("MainWndProc %d\n",message));
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4790
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4791
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4792
     * kludge while in sizeMove loop, which
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4793
     * is performed directly by DefWindowProc
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  4794
     * 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
  4795
     * 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
  4796
     */
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  4797
    cwi = pendingCREATEWINDOWInfo;
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  4798
    if (cwi) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4799
        int dummyWantDefault;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4800
        int seqNr = pendingSequenceNr;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4801
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4802
        pendingCREATEWINDOWInfo = 0;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4803
        pendingSequenceNr = INVALIDATED_CWI;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4804
        DPRINTF(("### THREAD_CREATEWINDOW\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4805
        winEventProcessing(0, WM_THREAD_CREATEWINDOW, seqNr, (LONG)cwi, &dummyWantDefault);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4806
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4807
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4808
    retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4809
    if (wantDefault) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4810
        DDPRINTF((">>DefWindowProc\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4811
        retVal = DefWindowProcW(hWnd, message, wParam, lParam);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4812
        DDPRINTF(("<<DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4813
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4814
    return retVal;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4815
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4816
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4817
static int CALLBACK
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  4818
EnumWindowsProc(HWND hwnd, LPARAM lParam)
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4819
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4820
        volatile OBJ *refToCollection;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4821
        OBJ collection;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4822
        OBJ wHandle;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4823
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4824
        if (hwnd) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4825
            refToCollection = (OBJ*) lParam;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4826
            __PROTECT__(*refToCollection);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4827
            wHandle = __MKEXTERNALADDRESS(hwnd);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4828
            __UNPROTECT__(*refToCollection);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4829
            collection = *refToCollection;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4830
            __SSEND1( collection, @symbol(add:), 0, wHandle );
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4831
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4832
        return TRUE;
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4833
}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4834
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4835
#define xxUSE_EnumFontFamiliesEx
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4836
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4837
static int CALLBACK
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4838
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData )
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4839
#ifdef USE_EnumFontFamiliesEx
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4840
        ENUMLOGFONTEX   *lplf;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4841
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4842
        LOGFONT         *lplf;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4843
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4844
        TEXTMETRIC      *lptm;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4845
        DWORD           dwType;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4846
        LPARAM          lpData;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4847
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4848
        OBJ t;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4849
        volatile OBJ *refToList;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4850
        OBJ  typeFaceList;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4851
        char *faceNameString;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4852
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4853
        if (lplf) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4854
            refToList = (OBJ*) lpData;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4855
            __PROTECT__(*refToList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4856
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4857
#ifdef USE_EnumFontFamiliesEx
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4858
            faceNameString = lplf->elfLogFont.lfFaceName;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4859
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4860
            faceNameString = lplf->lfFaceName;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4861
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4862
            t = __MKSTRING( faceNameString );
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4863
            __UNPROTECT__(*refToList);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4864
            typeFaceList = *refToList;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4865
            __SSEND1( typeFaceList, @symbol(add:), 0, t );
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4866
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4867
        return 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4868
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4869
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4870
/*
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4871
 * take a LOGFONT structure and extract relevant data into a smalltalk array.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4872
 *
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4873
 * Returned value is:
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4874
 *      #(
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4875
 *          1   lfHeight
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4876
 *          2   lfWidth
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4877
 *          3   lfEscapement
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4878
 *          4   lfOrientation
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4879
 *          5   lfWeight (Integer)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4880
 *          6   lfWeight (String)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4881
 *          7   lfItalic
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4882
 *          8   lfUnderline
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4883
 *          9   lfStrikeOut
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4884
 *         10   lfCharSet (Integer)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4885
 *         11   lfOutPrecision
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4886
 *         12   lfClipPrecision
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4887
 *         13   lfQuality
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4888
 *         14   lfPitchAndFamily
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4889
 *         15   face and style name (String i.e. "bold-roman")
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4890
 *         16   face name from windows
4014
Claus Gittinger <cg@exept.de>
parents: 4013
diff changeset
  4891
 *         17   character encoding lfCharSet (as String i.e. "ms_ansi", "ms_oem", "ms_cyrillic")
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4892
 *         18
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4893
 *         19
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4894
 *         20
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4895
 *       )
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4896
 * 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
  4897
 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  4898
OBJ
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  4899
__charSetSymbolFor(int charSet)
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4900
{
5576
1887b5235bf5 Use @symbol() instead of __MKSYMBOL() for constant symbols
Stefan Vogel <sv@exept.de>
parents: 5575
diff changeset
  4901
    OBJ s;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4902
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4903
    switch (charSet) {
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4904
        case ANSI_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4905
            s = @symbol('ms-ansi');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4906
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4907
        case DEFAULT_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4908
            s = @symbol('ms-default');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4909
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4910
        case SYMBOL_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4911
            s = @symbol('ms-symbol');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4912
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4913
        case SHIFTJIS_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4914
            s = @symbol('ms-shiftjis');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4915
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4916
        case GB2312_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4917
            s = @symbol('ms-gb2312');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4918
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4919
        case HANGEUL_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4920
            s = @symbol('ms-hangeul');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4921
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4922
# if defined(HANGUL_CHARSET) && (HANGUL_CHARSET != HANGEUL_CHARSET)
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4923
        case HANGUL_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4924
            s = @symbol('ms-hangul');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4925
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4926
# endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4927
        case CHINESEBIG5_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4928
            s = @symbol('ms-chinesebig5');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4929
            break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4930
        case OEM_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4931
            s = @symbol('ms-oem');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4932
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4933
# ifdef JOHAB_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4934
        case JOHAB_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4935
            s = @symbol('ms-johab');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4936
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4937
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4938
# ifdef HEBREW_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4939
        case HEBREW_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4940
            s = @symbol('ms-hebrew');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4941
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4942
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4943
# ifdef ARABIC_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4944
        case ARABIC_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4945
            s = @symbol('ms-arabic');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4946
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4947
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4948
# ifdef GREEK_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4949
        case GREEK_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4950
            s = @symbol('ms-greek');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4951
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4952
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4953
# ifdef TURKISH_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4954
        case TURKISH_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4955
            s = @symbol('ms-turkish');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4956
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4957
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4958
# ifdef RUSSIAN_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4959
        case RUSSIAN_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4960
            s = @symbol('ms-russian');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4961
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4962
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4963
# ifdef EASTEUROPE_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4964
        case EASTEUROPE_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4965
            s = @symbol('ms-easteurope');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4966
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4967
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4968
# ifdef BALTIC_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4969
        case BALTIC_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4970
            s = @symbol('ms-baltic');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4971
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4972
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4973
# ifdef VIETNAMESE_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4974
        case VIETNAMESE_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4975
            s = @symbol('ms-vietnamese');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4976
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4977
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4978
# ifdef THAI_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4979
        case THAI_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4980
            s = @symbol('ms-thai');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4981
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4982
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4983
# ifdef MAC_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4984
        case MAC_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4985
            s = @symbol('ms-mac');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4986
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4987
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4988
# ifdef UNICODE_CHARSET
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4989
        case UNICODE_CHARSET:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4990
            s = @symbol('ms-unicode');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4991
            break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4992
# endif
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4993
        default:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4994
            s = @symbol(unknown);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  4995
            break;
5576
1887b5235bf5 Use @symbol() instead of __MKSYMBOL() for constant symbols
Stefan Vogel <sv@exept.de>
parents: 5575
diff changeset
  4996
    }
1887b5235bf5 Use @symbol() instead of __MKSYMBOL() for constant symbols
Stefan Vogel <sv@exept.de>
parents: 5575
diff changeset
  4997
    return s;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4998
}
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  4999
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5000
OBJ
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  5001
__extractLogicalFontParameters(LOGFONT *lplf)
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5002
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5003
        OBJ newArray, t;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5004
        OBJ s;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5005
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5006
        DPRINTF((" lfHeight          %d\n", lplf->lfHeight ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5007
        DPRINTF((" lfWidth           %d\n", lplf->lfWidth  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5008
        DPRINTF((" lfEscapement      %d\n", lplf->lfEscapement  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5009
        DPRINTF((" lfOrientation     %d\n", lplf->lfOrientation  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5010
        DPRINTF((" lfWeight          %d\n", lplf->lfWeight  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5011
        DPRINTF((" lfItalic          %d\n", lplf->lfItalic  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5012
        DPRINTF((" lfUnderline       %d\n", lplf->lfUnderline  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5013
        DPRINTF((" lfStrikeOut       %d\n", lplf->lfStrikeOut  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5014
        DPRINTF((" lfCharSet         %d\n", lplf->lfCharSet  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5015
        DPRINTF((" lfOutPrecision    %d\n", lplf->lfOutPrecision  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5016
        DPRINTF((" lfClipPrecision   %d\n", lplf->lfClipPrecision  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5017
        DPRINTF((" lfQuality         %d\n", lplf->lfQuality  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5018
        DPRINTF((" lfPitchAndFamily  %d\n", lplf->lfPitchAndFamily  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5019
        DPRINTF((" lfFaceName        %s\n\n", lplf->lfFaceName  ));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5020
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5021
        newArray = __ARRAY_NEW_INT(20);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5022
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5023
        __ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5024
        __ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5025
        __ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5026
        __ArrayInstPtr(newArray)->a_element[3] = __MKSMALLINT(lplf->lfOrientation);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5027
        __ArrayInstPtr(newArray)->a_element[4] = __MKSMALLINT(lplf->lfWeight);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5028
        switch (lplf->lfWeight) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5029
            case FW_HEAVY:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5030
            case FW_EXTRABOLD:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5031
            case FW_SEMIBOLD:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5032
            case FW_BOLD:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5033
                s = @symbol(bold);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5034
                break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5035
            case FW_NORMAL:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5036
#if 0
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5037
                s = @symbol(normal);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5038
                break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5039
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5040
            case FW_MEDIUM:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5041
                s = @symbol(medium);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5042
                break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5043
            case FW_THIN:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5044
            case FW_EXTRALIGHT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5045
            case FW_LIGHT:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5046
                s = @symbol(demi);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5047
                break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5048
            default:
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5049
                s = @symbol(other);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5050
                break;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5051
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5052
        __ArrayInstPtr(newArray)->a_element[5] = s; __STORE(newArray, s);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5053
        __ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfItalic);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5054
        __ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfUnderline);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5055
        __ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfStrikeOut);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5056
        __ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfCharSet);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5057
        __ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfOutPrecision);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5058
        __ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfClipPrecision);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5059
        __ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfQuality);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5060
        __ArrayInstPtr(newArray)->a_element[13] = __MKSMALLINT(lplf->lfPitchAndFamily);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5061
        /* ... */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5062
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5063
        if( lplf->lfItalic == TRUE ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5064
            if( lplf->lfUnderline == TRUE ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5065
                if( lplf->lfStrikeOut == TRUE ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5066
                    s = @symbol('italic-underline-strikeOut');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5067
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5068
                    s = @symbol('italic-underline');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5069
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5070
            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5071
                if( lplf->lfStrikeOut == TRUE ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5072
                    s = @symbol('italic-strikeOut');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5073
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5074
                    s = @symbol('italic');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5075
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5076
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5077
        } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5078
            if( lplf->lfUnderline == TRUE ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5079
                if( lplf->lfStrikeOut == TRUE ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5080
                    s = @symbol('roman-underline-strikeOut');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5081
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5082
                    s = @symbol('roman-underline');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5083
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5084
            } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5085
                if( lplf->lfStrikeOut == TRUE ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5086
                    s = @symbol('roman-strikeOut');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5087
                } else {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5088
                    s = @symbol('roman');
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5089
                }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5090
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5091
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5092
        __ArrayInstPtr(newArray)->a_element[14] = s; __STORE(newArray, s);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5093
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5094
        __PROTECT__(newArray);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5095
        t = __MKSTRING(lplf->lfFaceName);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5096
        __UNPROTECT__(newArray);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5097
        __ArrayInstPtr(newArray)->a_element[15] = t; __STORE(newArray, t);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5098
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5099
        t = __charSetSymbolFor(lplf->lfCharSet);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5100
        __ArrayInstPtr(newArray)->a_element[16] = t; __STORE(newArray, t);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5101
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5102
        return newArray;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5103
}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5104
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5105
static int CALLBACK
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5106
EnumFontsProc( lplf, lptm, dwType, lpData )
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  5107
#ifdef USE_EnumFontFamiliesEx
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5108
        ENUMLOGFONTEX   *lplf;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5109
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5110
        LOGFONT         *lplf;     /* ptr to of logical-font data */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5111
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5112
        TEXTMETRIC      *lptm;     /* ptr to physical font data */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5113
        DWORD           dwType;    /* font type */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5114
        LPARAM          lpData;    /* application supplied data */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5115
{
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5116
        volatile OBJ *refToList;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5117
        OBJ list;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5118
        OBJ infoArray;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5119
        OBJ *fullName;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5120
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5121
        DPRINTF(("EnumFontsProc\n"));
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5122
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5123
        if ( lplf ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5124
            refToList = (OBJ*) lpData;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5125
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5126
            __PROTECT__(*refToList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  5127
#ifdef USE_EnumFontFamiliesEx
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5128
            infoArray = __extractLogicalFontParameters(lplf->elfLogFont);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5129
            __PROTECT__(infoArray);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5130
            fullName = __MKSTRING(lplf->elfFullName);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5131
            __UNPROTECT__(infoArray);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5132
            __ArrayInstPtr(infoArray)->a_element[17] = fullName; __STORE(infoArray, fullName);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5133
#else
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5134
            infoArray = __extractLogicalFontParameters(lplf);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5135
#endif
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5136
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5137
            __UNPROTECT__(*refToList);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5138
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5139
            if ( dwType & TRUETYPE_FONTTYPE ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5140
                /* change height to 0 to mark variable fonts */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5141
                __ArrayInstPtr(infoArray)->a_element[0] = __MKSMALLINT(0);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5142
            }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5143
            list = *refToList;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5144
            __SSEND1(list, @symbol(add:), 0, infoArray);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5145
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
  5146
        return 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5147
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5148
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5149
struct EnumDisplayMonitorsProcData {
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5150
    OBJ hArray;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5151
    int index;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5152
};
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5153
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5154
static int CALLBACK
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5155
EnumDisplayMonitorsProc( hMonitor, hdcMonitor, lprcMonitor, lpData )
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5156
    HMONITOR hMonitor;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5157
    HDC hdcMonitor;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5158
    LPRECT lprcMonitor;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5159
    struct EnumDisplayMonitorsProcData *lpData;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5160
{
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5161
    OBJ mHandle;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5162
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5163
    __PROTECT__(lpData->hArray);
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5164
    mHandle = __MKEXTERNALADDRESS(hMonitor);
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5165
    __UNPROTECT__(lpData->hArray);
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5166
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5167
    __ArrayInstPtr(lpData->hArray)->a_element[lpData->index] = mHandle;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5168
    __STORE(lpData->hArray, mHandle);
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5169
    lpData->index++;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5170
    return (1);
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5171
}
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5172
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5173
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5174
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5175
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5176
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5177
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5178
copyright
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5179
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5180
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5181
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5182
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5183
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5184
 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
  5185
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5186
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5187
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5188
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5189
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5190
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5191
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5192
documentation
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5193
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5194
    See more documentation in my superclass, DeviceWorkstation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5195
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5196
    [author:]
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  5197
	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
  5198
	Manfred Dierolf (many, many changes & fixes, multithreading etc.)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5199
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5200
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5201
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5202
!WinWorkstation class methodsFor:'initialization'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5203
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5204
initialize
5940
c7f52860ba82 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 5910
diff changeset
  5205
    "/ super initialize.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5206
    self initializeStandardColorNames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5207
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
  5208
    NativeWidgets := NativeDialogs := NativeFileDialogs := false.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5209
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  5210
    BeepDuration := 200.        "milliseconds"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5211
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5212
    ButtonTranslation := #(1 2 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5213
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  5214
    "/ SysColorChanges are reported *very* often when exceed is running,
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5215
    "/ but are also needed to update my view colors when the settings change.
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5216
    "/ I dont know what exceed is doing there ...
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5217
    "/ IgnoreSysColorChanges := true.
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5218
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5219
    "/ translation table from ST/X windowType symbol (system-independent)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5220
    "/ to Windows windowClass (windows-specific).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5221
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5222
    NativeWidgetClassTable := IdentityDictionary new.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5223
    NativeWidgetClassTable at:#ScrollBar                put:'SCROLLBAR'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5224
    NativeWidgetClassTable at:#HorizontalScrollBar      put:'SCROLLBAR'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5225
    NativeWidgetClassTable at:#VerticalScrollBar        put:'SCROLLBAR'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5226
    NativeWidgetClassTable at:#CheckBox                 put:'BUTTON'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5227
    NativeWidgetClassTable at:#RadioButton              put:'BUTTON'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5228
    NativeWidgetClassTable at:#Button                   put:'BUTTON'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5229
    NativeWidgetClassTable at:#DefaultButton            put:'BUTTON'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5230
    NativeWidgetClassTable at:#OwnerDrawButton          put:'BUTTON'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5231
    NativeWidgetClassTable at:#ComboBox                 put:'COMBOBOX'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5232
    NativeWidgetClassTable at:#EditField                put:'EDIT'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5233
    NativeWidgetClassTable at:#ListBox                  put:'LISTBOX'.
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
  5234
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
  5235
    "Modified: / 24-08-2010 / 16:42:23 / sr"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5236
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5237
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5238
initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5239
    "{ Pragma: +optSpace }"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5240
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5241
    "setup standard color names (X-color names)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5242
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5243
    StandardColorValues := Dictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5244
    #(
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5245
	(240 248 255)   'aliceblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5246
	(250 235 215)   'antiquewhite'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5247
	(255 239 219)   'AntiqueWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5248
	(238 223 204)   'AntiqueWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5249
	(205 192 176)   'AntiqueWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5250
	(139 131 120)   'AntiqueWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5251
	(127 255 212)   'aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5252
	(127 255 212)   'aquamarine1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5253
	(118 238 198)   'aquamarine2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5254
	(102 205 170)   'aquamarine3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5255
	( 69 139 116)   'aquamarine4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5256
	(240 255 255)   'azure'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5257
	(240 255 255)   'azure1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5258
	(224 238 238)   'azure2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5259
	(193 205 205)   'azure3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5260
	(131 139 139)   'azure4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5261
	(245 245 220)   'beige'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5262
	(255 228 196)   'bisque'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5263
	(255 228 196)   'bisque1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5264
	(238 213 183)   'bisque2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5265
	(205 183 158)   'bisque3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5266
	(139 125 107)   'bisque4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5267
	(  0   0   0)   'black'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5268
	(255 235 205)   'blanchedalmond'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5269
	(  0   0 255)   'blue'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5270
	(138  43 226)   'blueviolet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5271
	(  0   0 255)   'blue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5272
	(  0   0 238)   'blue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5273
	(  0   0 205)   'blue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5274
	(  0   0 139)   'blue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5275
	(165  42  42)   'brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5276
	(255  64  64)   'brown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5277
	(238  59  59)   'brown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5278
	(205  51  51)   'brown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5279
	(139  35  35)   'brown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5280
	(222 184 135)   'burlywood'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5281
	(255 211 155)   'burlywood1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5282
	(238 197 145)   'burlywood2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5283
	(205 170 125)   'burlywood3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5284
	(139 115  85)   'burlywood4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5285
	( 95 158 160)   'cadetblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5286
	(152 245 255)   'CadetBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5287
	(142 229 238)   'CadetBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5288
	(122 197 205)   'CadetBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5289
	( 83 134 139)   'CadetBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5290
	(127 255   0)   'chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5291
	(127 255   0)   'chartreuse1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5292
	(118 238   0)   'chartreuse2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5293
	(102 205   0)   'chartreuse3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5294
	( 69 139   0)   'chartreuse4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5295
	(210 105  30)   'chocolate'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5296
	(255 127  36)   'chocolate1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5297
	(238 118  33)   'chocolate2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5298
	(205 102  29)   'chocolate3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5299
	(139  69  19)   'chocolate4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5300
	(255 127  80)   'coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5301
	(255 114  86)   'coral1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5302
	(238 106  80)   'coral2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5303
	(205  91  69)   'coral3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5304
	(139  62  47)   'coral4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5305
	(100 149 237)   'cornflowerblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5306
	(255 248 220)   'cornsilk'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5307
	(255 248 220)   'cornsilk1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5308
	(238 232 205)   'cornsilk2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5309
	(205 200 177)   'cornsilk3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5310
	(139 136 120)   'cornsilk4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5311
	(  0 255 255)   'cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5312
	(  0 255 255)   'cyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5313
	(  0 238 238)   'cyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5314
	(  0 205 205)   'cyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5315
	(  0 139 139)   'cyan4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5316
	(  0   0 139)   'darkblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5317
	(  0 139 139)   'darkcyan'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5318
	(184 134  11)   'darkgoldenrod'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5319
	(169 169 169)   'darkgray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5320
	(  0 100   0)   'darkgreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5321
	(169 169 169)   'darkgrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5322
	(189 183 107)   'darkkhaki'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5323
	(139   0 139)   'darkmagenta'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5324
	( 85 107  47)   'darkolivegreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5325
	(255 140   0)   'darkorange'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5326
	(153  50 204)   'darkorchid'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5327
	(139   0   0)   'darkred'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5328
	(233 150 122)   'darksalmon'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5329
	(143 188 143)   'darkseagreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5330
	( 72  61 139)   'darkslateblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5331
	( 47  79  79)   'darkslategray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5332
	( 47  79  79)   'darkslategrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5333
	(  0 206 209)   'darkturquoise'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5334
	(148   0 211)   'darkviolet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5335
	(255 185  15)   'DarkGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5336
	(238 173  14)   'DarkGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5337
	(205 149  12)   'DarkGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5338
	(139 101   8)   'DarkGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5339
	(202 255 112)   'DarkOliveGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5340
	(188 238 104)   'DarkOliveGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5341
	(162 205  90)   'DarkOliveGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5342
	(110 139  61)   'DarkOliveGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5343
	(255 127   0)   'DarkOrange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5344
	(238 118   0)   'DarkOrange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5345
	(205 102   0)   'DarkOrange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5346
	(139  69   0)   'DarkOrange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5347
	(191  62 255)   'DarkOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5348
	(178  58 238)   'DarkOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5349
	(154  50 205)   'DarkOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5350
	(104  34 139)   'DarkOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5351
	(193 255 193)   'DarkSeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5352
	(180 238 180)   'DarkSeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5353
	(155 205 155)   'DarkSeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5354
	(105 139 105)   'DarkSeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5355
	(151 255 255)   'DarkSlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5356
	(141 238 238)   'DarkSlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5357
	(121 205 205)   'DarkSlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5358
	( 82 139 139)   'DarkSlateGray4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5359
	(255  20 147)   'deeppink'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5360
	(  0 191 255)   'deepskyblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5361
	(255  20 147)   'DeepPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5362
	(255  20 147)   'DeepPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5363
	(238  18 137)   'DeepPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5364
	(205  16 118)   'DeepPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5365
	(139  10  80)   'DeepPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5366
	(  0 191 255)   'DeepSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5367
	(  0 178 238)   'DeepSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5368
	(  0 154 205)   'DeepSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5369
	(  0 104 139)   'DeepSkyBlue4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5370
	(105 105 105)   'dimgray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5371
	(105 105 105)   'dimgrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5372
	( 30 144 255)   'dodgerblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5373
	( 30 144 255)   'DodgerBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5374
	( 28 134 238)   'DodgerBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5375
	( 24 116 205)   'DodgerBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5376
	( 16  78 139)   'DodgerBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5377
	(178  34  34)   'firebrick'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5378
	(255  48  48)   'firebrick1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5379
	(238  44  44)   'firebrick2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5380
	(205  38  38)   'firebrick3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5381
	(139  26  26)   'firebrick4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5382
	(255 250 240)   'floralwhite'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5383
	( 34 139  34)   'forestgreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5384
	(220 220 220)   'gainsboro'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5385
	(248 248 255)   'ghostwhite'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5386
	(255 215   0)   'gold'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5387
	(255 215   0)   'gold1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5388
	(238 201   0)   'gold2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5389
	(205 173   0)   'gold3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5390
	(139 117   0)   'gold4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5391
	(218 165  32)   'goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5392
	(255 193  37)   'goldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5393
	(238 180  34)   'goldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5394
	(205 155  29)   'goldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5395
	(139 105  20)   'goldenrod4'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5396
	(192 192 192)   'grey'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5397
	(  0   0   0)   'grey0'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5398
	(  3   3   3)   'grey1'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5399
	( 26  26  26)   'grey10'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5400
	(255 255 255)   'grey100'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5401
	( 28  28  28)   'grey11'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5402
	( 31  31  31)   'grey12'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5403
	( 33  33  33)   'grey13'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5404
	( 36  36  36)   'grey14'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5405
	( 38  38  38)   'grey15'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5406
	( 41  41  41)   'grey16'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5407
	( 43  43  43)   'grey17'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5408
	( 46  46  46)   'grey18'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5409
	( 48  48  48)   'grey19'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5410
	(  5   5   5)   'grey2'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5411
	( 51  51  51)   'grey20'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5412
	( 54  54  54)   'grey21'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5413
	( 56  56  56)   'grey22'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5414
	( 59  59  59)   'grey23'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5415
	( 61  61  61)   'grey24'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5416
	( 64  64  64)   'grey25'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5417
	( 66  66  66)   'grey26'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5418
	( 69  69  69)   'grey27'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5419
	( 71  71  71)   'grey28'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5420
	( 74  74  74)   'grey29'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5421
	(  8   8   8)   'grey3'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5422
	( 77  77  77)   'grey30'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5423
	( 79  79  79)   'grey31'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5424
	( 82  82  82)   'grey32'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5425
	( 84  84  84)   'grey33'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5426
	( 87  87  87)   'grey34'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5427
	( 89  89  89)   'grey35'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5428
	( 92  92  92)   'grey36'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5429
	( 94  94  94)   'grey37'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5430
	( 97  97  97)   'grey38'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5431
	( 99  99  99)   'grey39'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5432
	( 10  10  10)   'grey4'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5433
	(102 102 102)   'grey40'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5434
	(105 105 105)   'grey41'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5435
	(107 107 107)   'grey42'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5436
	(110 110 110)   'grey43'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5437
	(112 112 112)   'grey44'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5438
	(115 115 115)   'grey45'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5439
	(117 117 117)   'grey46'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5440
	(120 120 120)   'grey47'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5441
	(122 122 122)   'grey48'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5442
	(125 125 125)   'grey49'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5443
	( 13  13  13)   'grey5'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5444
	(127 127 127)   'grey50'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5445
	(130 130 130)   'grey51'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5446
	(133 133 133)   'grey52'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5447
	(135 135 135)   'grey53'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5448
	(138 138 138)   'grey54'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5449
	(140 140 140)   'grey55'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5450
	(143 143 143)   'grey56'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5451
	(145 145 145)   'grey57'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5452
	(148 148 148)   'grey58'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5453
	(150 150 150)   'grey59'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5454
	( 15  15  15)   'grey6'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5455
	(153 153 153)   'grey60'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5456
	(156 156 156)   'grey61'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5457
	(158 158 158)   'grey62'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5458
	(161 161 161)   'grey63'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5459
	(163 163 163)   'grey64'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5460
	(166 166 166)   'grey65'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5461
	(168 168 168)   'grey66'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5462
	(171 171 171)   'grey67'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5463
	(173 173 173)   'grey68'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5464
	(176 176 176)   'grey69'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5465
	( 18  18  18)   'grey7'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5466
	(179 179 179)   'grey70'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5467
	(181 181 181)   'grey71'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5468
	(184 184 184)   'grey72'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5469
	(186 186 186)   'grey73'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5470
	(189 189 189)   'grey74'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5471
	(191 191 191)   'grey75'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5472
	(194 194 194)   'grey76'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5473
	(196 196 196)   'grey77'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5474
	(199 199 199)   'grey78'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5475
	(201 201 201)   'grey79'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5476
	( 20  20  20)   'grey8'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5477
	(204 204 204)   'grey80'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5478
	(207 207 207)   'grey81'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5479
	(209 209 209)   'grey82'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5480
	(212 212 212)   'grey83'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5481
	(214 214 214)   'grey84'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5482
	(217 217 217)   'grey85'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5483
	(219 219 219)   'grey86'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5484
	(222 222 222)   'grey87'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5485
	(224 224 224)   'grey88'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5486
	(227 227 227)   'grey89'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5487
	( 23  23  23)   'grey9'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5488
	(229 229 229)   'grey90'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5489
	(232 232 232)   'grey91'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5490
	(235 235 235)   'grey92'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5491
	(237 237 237)   'grey93'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5492
	(240 240 240)   'grey94'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5493
	(242 242 242)   'grey95'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5494
	(245 245 245)   'grey96'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5495
	(247 247 247)   'grey97'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5496
	(250 250 250)   'grey98'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5497
	(252 252 252)   'grey99'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5498
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5499
	(192 192 192)   'gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5500
	(  0   0   0)   'gray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5501
	(  3   3   3)   'gray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5502
	( 26  26  26)   'gray10'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5503
	(255 255 255)   'gray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5504
	( 28  28  28)   'gray11'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5505
	( 31  31  31)   'gray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5506
	( 33  33  33)   'gray13'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5507
	( 36  36  36)   'gray14'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5508
	( 38  38  38)   'gray15'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5509
	( 41  41  41)   'gray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5510
	( 43  43  43)   'gray17'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5511
	( 46  46  46)   'gray18'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5512
	( 48  48  48)   'gray19'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5513
	(  5   5   5)   'gray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5514
	( 51  51  51)   'gray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5515
	( 54  54  54)   'gray21'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5516
	( 56  56  56)   'gray22'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5517
	( 59  59  59)   'gray23'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5518
	( 61  61  61)   'gray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5519
	( 64  64  64)   'gray25'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5520
	( 66  66  66)   'gray26'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5521
	( 69  69  69)   'gray27'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5522
	( 71  71  71)   'gray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5523
	( 74  74  74)   'gray29'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5524
	(  8   8   8)   'gray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5525
	( 77  77  77)   'gray30'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5526
	( 79  79  79)   'gray31'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5527
	( 82  82  82)   'gray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5528
	( 84  84  84)   'gray33'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5529
	( 87  87  87)   'gray34'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5530
	( 89  89  89)   'gray35'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5531
	( 92  92  92)   'gray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5532
	( 94  94  94)   'gray37'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5533
	( 97  97  97)   'gray38'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5534
	( 99  99  99)   'gray39'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5535
	( 10  10  10)   'gray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5536
	(102 102 102)   'gray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5537
	(105 105 105)   'gray41'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5538
	(107 107 107)   'gray42'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5539
	(110 110 110)   'gray43'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5540
	(112 112 112)   'gray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5541
	(115 115 115)   'gray45'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5542
	(117 117 117)   'gray46'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5543
	(120 120 120)   'gray47'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5544
	(122 122 122)   'gray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5545
	(125 125 125)   'gray49'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5546
	( 13  13  13)   'gray5'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5547
	(127 127 127)   'gray50'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5548
	(130 130 130)   'gray51'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5549
	(133 133 133)   'gray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5550
	(135 135 135)   'gray53'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5551
	(138 138 138)   'gray54'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5552
	(140 140 140)   'gray55'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5553
	(143 143 143)   'gray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5554
	(145 145 145)   'gray57'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5555
	(148 148 148)   'gray58'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5556
	(150 150 150)   'gray59'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5557
	( 15  15  15)   'gray6'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5558
	(153 153 153)   'gray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5559
	(156 156 156)   'gray61'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5560
	(158 158 158)   'gray62'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5561
	(161 161 161)   'gray63'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5562
	(163 163 163)   'gray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5563
	(166 166 166)   'gray65'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5564
	(168 168 168)   'gray66'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5565
	(171 171 171)   'gray67'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5566
	(173 173 173)   'gray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5567
	(176 176 176)   'gray69'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5568
	( 18  18  18)   'gray7'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5569
	(179 179 179)   'gray70'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5570
	(181 181 181)   'gray71'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5571
	(184 184 184)   'gray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5572
	(186 186 186)   'gray73'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5573
	(189 189 189)   'gray74'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5574
	(191 191 191)   'gray75'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5575
	(194 194 194)   'gray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5576
	(196 196 196)   'gray77'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5577
	(199 199 199)   'gray78'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5578
	(201 201 201)   'gray79'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5579
	( 20  20  20)   'gray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5580
	(204 204 204)   'gray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5581
	(207 207 207)   'gray81'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5582
	(209 209 209)   'gray82'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5583
	(212 212 212)   'gray83'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5584
	(214 214 214)   'gray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5585
	(217 217 217)   'gray85'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5586
	(219 219 219)   'gray86'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5587
	(222 222 222)   'gray87'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5588
	(224 224 224)   'gray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5589
	(227 227 227)   'gray89'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5590
	( 23  23  23)   'gray9'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5591
	(229 229 229)   'gray90'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5592
	(232 232 232)   'gray91'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5593
	(235 235 235)   'gray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5594
	(237 237 237)   'gray93'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5595
	(240 240 240)   'gray94'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5596
	(242 242 242)   'gray95'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5597
	(245 245 245)   'gray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5598
	(247 247 247)   'gray97'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5599
	(250 250 250)   'gray98'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5600
	(252 252 252)   'gray99'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5601
	(  0 255   0)   'green'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5602
	(173 255  47)   'greenyellow'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5603
	(  0 255   0)   'green1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5604
	(  0 238   0)   'green2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5605
	(  0 205   0)   'green3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5606
	(  0 139   0)   'green4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5607
	(240 255 240)   'honeydew'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5608
	(240 255 240)   'honeydew1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5609
	(224 238 224)   'honeydew2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5610
	(193 205 193)   'honeydew3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5611
	(131 139 131)   'honeydew4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5612
	(255 105 180)   'hotpink'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5613
	(255 110 180)   'HotPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5614
	(238 106 167)   'HotPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5615
	(205  96 144)   'HotPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5616
	(139  58  98)   'HotPink4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5617
	(205  92  92)   'indianred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5618
	(255 106 106)   'IndianRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5619
	(238  99  99)   'IndianRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5620
	(205  85  85)   'IndianRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5621
	(139  58  58)   'IndianRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5622
	(255 255 240)   'ivory'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5623
	(255 255 240)   'ivory1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5624
	(238 238 224)   'ivory2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5625
	(205 205 193)   'ivory3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5626
	(139 139 131)   'ivory4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5627
	(240 230 140)   'khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5628
	(255 246 143)   'khaki1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5629
	(238 230 133)   'khaki2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5630
	(205 198 115)   'khaki3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5631
	(139 134  78)   'khaki4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5632
	(230 230 250)   'lavender'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5633
	(255 240 245)   'lavenderblush'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5634
	(255 240 245)   'LavenderBlush1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5635
	(238 224 229)   'LavenderBlush2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5636
	(205 193 197)   'LavenderBlush3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5637
	(139 131 134)   'LavenderBlush4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5638
	(124 252   0)   'lawngreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5639
	(255 250 205)   'lemonchiffon'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5640
	(255 250 205)   'LemonChiffon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5641
	(238 233 191)   'LemonChiffon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5642
	(205 201 165)   'LemonChiffon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5643
	(139 137 112)   'LemonChiffon4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5644
	(173 216 230)   'lightblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5645
	(240 128 128)   'lightcoral'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5646
	(224 255 255)   'lightcyan'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5647
	(238 221 130)   'lightgoldenrod'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5648
	(250 250 210)   'lightgoldenrodyellow'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5649
	(211 211 211)   'lightgray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5650
	(144 238 144)   'lightgreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5651
	(211 211 211)   'lightgrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5652
	(255 182 193)   'lightpink'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5653
	(255 160 122)   'lightsalmon'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5654
	( 32 178 170)   'lightseagreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5655
	(135 206 250)   'lightskyblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5656
	(132 112 255)   'lightslateblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5657
	(119 136 153)   'lightslategray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5658
	(119 136 153)   'lightslategrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5659
	(176 196 222)   'lightsteelblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5660
	(255 255 224)   'lightyellow'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5661
	(191 239 255)   'LightBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5662
	(178 223 238)   'LightBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5663
	(154 192 205)   'LightBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5664
	(104 131 139)   'LightBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5665
	(224 255 255)   'LightCyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5666
	(209 238 238)   'LightCyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5667
	(180 205 205)   'LightCyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5668
	(122 139 139)   'LightCyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5669
	(255 236 139)   'LightGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5670
	(238 220 130)   'LightGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5671
	(205 190 112)   'LightGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5672
	(139 129  76)   'LightGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5673
	(255 174 185)   'LightPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5674
	(238 162 173)   'LightPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5675
	(205 140 149)   'LightPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5676
	(139  95 101)   'LightPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5677
	(255 160 122)   'LightSalmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5678
	(238 149 114)   'LightSalmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5679
	(205 129  98)   'LightSalmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5680
	(139  87  66)   'LightSalmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5681
	(176 226 255)   'LightSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5682
	(164 211 238)   'LightSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5683
	(141 182 205)   'LightSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5684
	( 96 123 139)   'LightSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5685
	(202 225 255)   'LightSteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5686
	(188 210 238)   'LightSteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5687
	(162 181 205)   'LightSteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5688
	(110 123 139)   'LightSteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5689
	(255 255 224)   'LightYellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5690
	(238 238 209)   'LightYellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5691
	(205 205 180)   'LightYellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5692
	(139 139 122)   'LightYellow4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5693
	( 50 205  50)   'limegreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5694
	(250 240 230)   'linen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5695
	(255   0 255)   'magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5696
	(255   0 255)   'magenta1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5697
	(238   0 238)   'magenta2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5698
	(205   0 205)   'magenta3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5699
	(139   0 139)   'magenta4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5700
	(176  48  96)   'maroon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5701
	(255  52 179)   'maroon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5702
	(238  48 167)   'maroon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5703
	(205  41 144)   'maroon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5704
	(139  28  98)   'maroon4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5705
	(102 205 170)   'mediumaquamarine'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5706
	(  0   0 205)   'mediumblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5707
	(186  85 211)   'mediumorchid'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5708
	(147 112 219)   'mediumpurple'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5709
	( 60 179 113)   'mediumseagreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5710
	(123 104 238)   'mediumslateblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5711
	(  0 250 154)   'mediumspringgreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5712
	( 72 209 204)   'mediumturquoise'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5713
	(199  21 133)   'mediumvioletred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5714
	(224 102 255)   'MediumOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5715
	(209  95 238)   'MediumOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5716
	(180  82 205)   'MediumOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5717
	(122  55 139)   'MediumOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5718
	(171 130 255)   'MediumPurple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5719
	(159 121 238)   'MediumPurple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5720
	(137 104 205)   'MediumPurple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5721
	( 93  71 139)   'MediumPurple4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5722
	( 25  25 112)   'midnightblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5723
	(245 255 250)   'mintcream'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5724
	(255 228 225)   'mistyrose'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5725
	(255 228 225)   'MistyRose1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5726
	(238 213 210)   'MistyRose2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5727
	(205 183 181)   'MistyRose3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5728
	(139 125 123)   'MistyRose4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5729
	(255 228 181)   'moccasin'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5730
	(255 222 173)   'navajowhite'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5731
	(255 222 173)   'NavajoWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5732
	(238 207 161)   'NavajoWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5733
	(205 179 139)   'NavajoWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5734
	(139 121  94)   'NavajoWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5735
	(  0   0 128)   'navy'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5736
	(  0   0 128)   'navyblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5737
	(253 245 230)   'oldlace'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5738
	(107 142  35)   'olivedrab'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5739
	(192 255  62)   'OliveDrab1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5740
	(179 238  58)   'OliveDrab2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5741
	(154 205  50)   'OliveDrab3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5742
	(105 139  34)   'OliveDrab4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5743
	(255 165   0)   'orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5744
	(255 165   0)   'orange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5745
	(238 154   0)   'orange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5746
	(205 133   0)   'orange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5747
	(139  90   0)   'orange4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5748
	(255  69   0)   'orangered'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5749
	(255  69   0)   'OrangeRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5750
	(238  64   0)   'OrangeRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5751
	(205  55   0)   'OrangeRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5752
	(139  37   0)   'OrangeRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5753
	(218 112 214)   'orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5754
	(255 131 250)   'orchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5755
	(238 122 233)   'orchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5756
	(205 105 201)   'orchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5757
	(139  71 137)   'orchid4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5758
	(238 232 170)   'palegoldenrod'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5759
	(152 251 152)   'palegreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5760
	(175 238 238)   'paleturquoise'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5761
	(219 112 147)   'palevioletred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5762
	(154 255 154)   'PaleGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5763
	(144 238 144)   'PaleGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5764
	(124 205 124)   'PaleGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5765
	( 84 139  84)   'PaleGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5766
	(187 255 255)   'PaleTurquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5767
	(174 238 238)   'PaleTurquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5768
	(150 205 205)   'PaleTurquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5769
	(102 139 139)   'PaleTurquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5770
	(255 130 171)   'PaleVioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5771
	(238 121 159)   'PaleVioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5772
	(205 104 137)   'PaleVioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5773
	(139  71  93)   'PaleVioletRed4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5774
	(255 239 213)   'papayawhip'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5775
	(255 218 185)   'peachpuff'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5776
	(255 218 185)   'PeachPuff1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5777
	(238 203 173)   'PeachPuff2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5778
	(205 175 149)   'PeachPuff3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5779
	(139 119 101)   'PeachPuff4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5780
	(205 133  63)   'peru'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5781
	(255 192 203)   'pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5782
	(255 181 197)   'pink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5783
	(238 169 184)   'pink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5784
	(205 145 158)   'pink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5785
	(139  99 108)   'pink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5786
	(221 160 221)   'plum'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5787
	(255 187 255)   'plum1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5788
	(238 174 238)   'plum2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5789
	(205 150 205)   'plum3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5790
	(139 102 139)   'plum4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5791
	(176 224 230)   'powderblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5792
	(160  32 240)   'purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5793
	(155  48 255)   'purple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5794
	(145  44 238)   'purple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5795
	(125  38 205)   'purple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5796
	( 85  26 139)   'purple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5797
	(255   0   0)   'red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5798
	(255   0   0)   'red1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5799
	(238   0   0)   'red2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5800
	(205   0   0)   'red3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5801
	(139   0   0)   'red4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5802
	(188 143 143)   'rosybrown'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5803
	(255 193 193)   'RosyBrown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5804
	(238 180 180)   'RosyBrown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5805
	(205 155 155)   'RosyBrown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5806
	(139 105 105)   'RosyBrown4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5807
	( 65 105 225)   'royalblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5808
	( 72 118 255)   'RoyalBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5809
	( 67 110 238)   'RoyalBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5810
	( 58  95 205)   'RoyalBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5811
	( 39  64 139)   'RoyalBlue4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5812
	(139  69  19)   'saddlebrown'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5813
	(250 128 114)   'salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5814
	(255 140 105)   'salmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5815
	(238 130  98)   'salmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5816
	(205 112  84)   'salmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5817
	(139  76  57)   'salmon4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5818
	(244 164  96)   'sandybrown'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5819
	( 255 206 137)  'scoActiveBackground'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5820
	( 43  45  49)   'scoActiveForeground'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5821
	( 254 222 255)  'scoActiveTopShadow'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5822
	( 172 186 204)  'scoAltBackground'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5823
	( 203 203 192)  'scoBackground'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5824
	( 11   0 113)   'scoForeground'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5825
	( 141 178 215)  'scoHighlight'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5826
	( 255 240 248)  'scoTopShadow'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5827
	( 46 139  87)   'seagreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5828
	( 84 255 159)   'SeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5829
	( 78 238 148)   'SeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5830
	( 67 205 128)   'SeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5831
	( 46 139  87)   'SeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5832
	(255 245 238)   'seashell'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5833
	(255 245 238)   'seashell1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5834
	(238 229 222)   'seashell2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5835
	(205 197 191)   'seashell3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5836
	(139 134 130)   'seashell4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5837
	(142 56 142)    'sgi beet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5838
	(197 193 170)   'sgi bright gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5839
	(197 193 170)   'sgi bright grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5840
	(113 198 113)   'sgi chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5841
	( 85  85  85)   'sgi dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5842
	( 85  85  85)   'sgi dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5843
	(  0   0   0)   'sgi gray 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5844
	(255 255 255)   'sgi gray 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5845
	( 30  30  30)   'sgi gray 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5846
	( 40  40  40)   'sgi gray 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5847
	( 51  51  51)   'sgi gray 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5848
	( 61  61  61)   'sgi gray 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5849
	( 71  71  71)   'sgi gray 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5850
	( 81  81  81)   'sgi gray 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5851
	( 91  91  91)   'sgi gray 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5852
	( 10  10  10)   'sgi gray 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5853
	(102 102 102)   'sgi gray 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5854
	(112 112 112)   'sgi gray 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5855
	(122 122 122)   'sgi gray 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5856
	(132 132 132)   'sgi gray 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5857
	(142 142 142)   'sgi gray 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5858
	(153 153 153)   'sgi gray 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5859
	(163 163 163)   'sgi gray 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5860
	(173 173 173)   'sgi gray 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5861
	(183 183 183)   'sgi gray 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5862
	(193 193 193)   'sgi gray 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5863
	( 20  20  20)   'sgi gray 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5864
	(204 204 204)   'sgi gray 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5865
	(214 214 214)   'sgi gray 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5866
	(224 224 224)   'sgi gray 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5867
	(234 234 234)   'sgi gray 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5868
	(244 244 244)   'sgi gray 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5869
	(  0   0   0)   'sgi grey 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5870
	(255 255 255)   'sgi grey 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5871
	( 30  30  30)   'sgi grey 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5872
	( 40  40  40)   'sgi grey 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5873
	( 51  51  51)   'sgi grey 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5874
	( 61  61  61)   'sgi grey 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5875
	( 71  71  71)   'sgi grey 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5876
	( 81  81  81)   'sgi grey 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5877
	( 91  91  91)   'sgi grey 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5878
	( 10  10  10)   'sgi grey 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5879
	(102 102 102)   'sgi grey 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5880
	(112 112 112)   'sgi grey 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5881
	(122 122 122)   'sgi grey 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5882
	(132 132 132)   'sgi grey 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5883
	(142 142 142)   'sgi grey 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5884
	(153 153 153)   'sgi grey 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5885
	(163 163 163)   'sgi grey 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5886
	(173 173 173)   'sgi grey 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5887
	(183 183 183)   'sgi grey 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5888
	(193 193 193)   'sgi grey 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5889
	( 20  20  20)   'sgi grey 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5890
	(204 204 204)   'sgi grey 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5891
	(214 214 214)   'sgi grey 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5892
	(224 224 224)   'sgi grey 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5893
	(234 234 234)   'sgi grey 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5894
	(244 244 244)   'sgi grey 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5895
	(125 158 192)   'sgi light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5896
	(170 170 170)   'sgi light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5897
	(170 170 170)   'sgi light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5898
	(132 132 132)   'sgi medium gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5899
	(132 132 132)   'sgi medium grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5900
	(142 142  56)   'sgi olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5901
	(198 113 113)   'sgi salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5902
	(113 113 198)   'sgi slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5903
	( 56 142 142)   'sgi teal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5904
	( 40  40  40)   'sgi very dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5905
	( 40  40  40)   'sgi very dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5906
	(214 214 214)   'sgi very light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5907
	(214 214 214)   'sgi very light grey'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5908
	(142 56 142)    'SGIBeet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5909
	(197 193 170)   'SGIBrightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5910
	(197 193 170)   'SGIBrightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5911
	(113 198 113)   'SGIChartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5912
	( 85  85  85)   'SGIDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5913
	( 85  85  85)   'SGIDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5914
	(  0   0   0)   'SGIGray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5915
	(255 255 255)   'SGIGray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5916
	( 30  30  30)   'SGIGray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5917
	( 40  40  40)   'SGIGray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5918
	( 51  51  51)   'SGIGray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5919
	( 61  61  61)   'SGIGray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5920
	( 71  71  71)   'SGIGray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5921
	( 81  81  81)   'SGIGray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5922
	( 91  91  91)   'SGIGray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5923
	( 10  10  10)   'SGIGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5924
	(102 102 102)   'SGIGray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5925
	(112 112 112)   'SGIGray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5926
	(122 122 122)   'SGIGray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5927
	(132 132 132)   'SGIGray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5928
	(142 142 142)   'SGIGray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5929
	(153 153 153)   'SGIGray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5930
	(163 163 163)   'SGIGray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5931
	(173 173 173)   'SGIGray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5932
	(183 183 183)   'SGIGray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5933
	(193 193 193)   'SGIGray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5934
	( 20  20  20)   'SGIGray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5935
	(204 204 204)   'SGIGray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5936
	(214 214 214)   'SGIGray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5937
	(224 224 224)   'SGIGray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5938
	(234 234 234)   'SGIGray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5939
	(244 244 244)   'SGIGray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5940
	(  0   0   0)   'SGIGrey0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5941
	(255 255 255)   'SGIGrey100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5942
	( 30  30  30)   'SGIGrey12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5943
	( 40  40  40)   'SGIGrey16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5944
	( 51  51  51)   'SGIGrey20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5945
	( 61  61  61)   'SGIGrey24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5946
	( 71  71  71)   'SGIGrey28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5947
	( 81  81  81)   'SGIGrey32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5948
	( 91  91  91)   'SGIGrey36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5949
	( 10  10  10)   'SGIGrey4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5950
	(102 102 102)   'SGIGrey40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5951
	(112 112 112)   'SGIGrey44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5952
	(122 122 122)   'SGIGrey48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5953
	(132 132 132)   'SGIGrey52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5954
	(142 142 142)   'SGIGrey56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5955
	(153 153 153)   'SGIGrey60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5956
	(163 163 163)   'SGIGrey64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5957
	(173 173 173)   'SGIGrey68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5958
	(183 183 183)   'SGIGrey72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5959
	(193 193 193)   'SGIGrey76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5960
	( 20  20  20)   'SGIGrey8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5961
	(204 204 204)   'SGIGrey80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5962
	(214 214 214)   'SGIGrey84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5963
	(224 224 224)   'SGIGrey88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5964
	(234 234 234)   'SGIGrey92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5965
	(244 244 244)   'SGIGrey96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5966
	(125 158 192)   'SGILightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5967
	(170 170 170)   'SGILightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5968
	(170 170 170)   'SGILightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5969
	(132 132 132)   'SGIMediumGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5970
	(132 132 132)   'SGIMediumGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5971
	(142 142  56)   'SGIOliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5972
	(198 113 113)   'SGISalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5973
	(113 113 198)   'SGISlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5974
	( 56 142 142)   'SGITeal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5975
	( 40  40  40)   'SGIVeryDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5976
	( 40  40  40)   'SGIVeryDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5977
	(214 214 214)   'SGIVeryLightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5978
	(214 214 214)   'SGIVeryLightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5979
	(160  82  45)   'sienna'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5980
	(255 130  71)   'sienna1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5981
	(238 121  66)   'sienna2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5982
	(205 104  57)   'sienna3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5983
	(139  71  38)   'sienna4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5984
	(135 206 235)   'skyblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5985
	(135 206 255)   'SkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5986
	(126 192 238)   'SkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5987
	(108 166 205)   'SkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5988
	( 74 112 139)   'SkyBlue4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5989
	(112 128 144)   'slategray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5990
	(112 128 144)   'slategrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5991
	(106  90 205)   'slateblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5992
	(131 111 255)   'SlateBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5993
	(122 103 238)   'SlateBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5994
	(105  89 205)   'SlateBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5995
	( 71  60 139)   'SlateBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5996
	(198 226 255)   'SlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5997
	(185 211 238)   'SlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5998
	(159 182 205)   'SlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5999
	(108 123 139)   'SlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6000
	(255 250 250)   'snow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6001
	(255 250 250)   'snow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6002
	(238 233 233)   'snow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6003
	(205 201 201)   'snow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6004
	(139 137 137)   'snow4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6005
	(  0 255 127)   'springgreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6006
	(  0 255 127)   'SpringGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6007
	(  0 238 118)   'SpringGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6008
	(  0 205 102)   'SpringGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6009
	(  0 139  69)   'SpringGreen4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6010
	( 70 130 180)   'steelblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6011
	( 99 184 255)   'SteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6012
	( 92 172 238)   'SteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6013
	( 79 148 205)   'SteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6014
	( 54 100 139)   'SteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6015
	(210 180 140)   'tan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6016
	(255 165  79)   'tan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6017
	(238 154  73)   'tan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6018
	(205 133  63)   'tan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6019
	(139  90  43)   'tan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6020
	(216 191 216)   'thistle'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6021
	(255 225 255)   'thistle1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6022
	(238 210 238)   'thistle2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6023
	(205 181 205)   'thistle3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6024
	(139 123 139)   'thistle4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6025
	(255  99  71)   'tomato'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6026
	(255  99  71)   'tomato1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6027
	(238  92  66)   'tomato2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6028
	(205  79  57)   'tomato3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6029
	(139  54  38)   'tomato4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6030
	( 64 224 208)   'turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6031
	(  0 245 255)   'turquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6032
	(  0 229 238)   'turquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6033
	(  0 197 205)   'turquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6034
	(  0 134 139)   'turquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6035
	(238 130 238)   'violet'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6036
	(208  32 144)   'violetred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6037
	(255  62 150)   'VioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6038
	(238  58 140)   'VioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6039
	(205  50 120)   'VioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6040
	(139  34  82)   'VioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6041
	(245 222 179)   'wheat'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6042
	(255 231 186)   'wheat1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6043
	(238 216 174)   'wheat2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6044
	(205 186 150)   'wheat3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6045
	(139 126 102)   'wheat4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6046
	(255 255 255)   'white'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6047
	(245 245 245)   'whitesmoke'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6048
	(255 255   0)   'yellow'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6049
	(154 205  50)   'yellowgreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6050
	(255 255   0)   'yellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6051
	(238 238   0)   'yellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6052
	(205 205   0)   'yellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6053
	(139 139   0)   'yellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6054
    ) pairWiseDo:[ :value :name |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6055
	StandardColorValues at:name put:value
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6056
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6057
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6058
     WinWorkstation initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6059
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6060
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6061
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6062
!WinWorkstation class methodsFor:'debugging'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6063
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6064
bitmapHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6065
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6066
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6067
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6068
#ifdef COUNT_BMP_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6069
    RETURN ( __MKSMALLINT(__cnt_bitmap));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6070
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6071
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6072
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6073
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6074
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6075
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6076
cursorHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6077
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6078
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6079
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6080
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6081
    RETURN ( __MKSMALLINT(__cnt_cur));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6082
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6083
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6084
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6085
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6086
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6087
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6088
debug
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6089
%{  /* NOCONTEXT */
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6090
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6091
    RETURN (__debug__ != 0 ? true : false);
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6092
%}
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6093
!
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6094
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6095
debug2
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6096
    "enable more debug prints - this will vanish"
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6097
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6098
%{  /* NOCONTEXT */
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6099
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6100
    __debug__ = 2;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6101
%}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6102
!
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6103
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6104
debug:aBoolean
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6105
    "enable/disable debug prints - this will vanish"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6106
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6107
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6108
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6109
    __debug__ = (aBoolean == true) ? 1 : 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6110
%}
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6111
    "
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6112
     WinWorkstation debug:true
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6113
     WinWorkstation debug:false
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6114
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6115
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6116
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6117
debug:aBoolean message:msg
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6118
    msg = 'WM_MOUSEENTER' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6119
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6120
	__debug_WM_MOUSEENTER__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6121
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6122
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6123
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6124
    msg = 'WM_MOUSELEAVE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6125
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6126
	__debug_WM_MOUSELEAVE__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6127
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6128
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6129
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6130
    msg = 'WM_MOUSEMOVE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6131
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6132
	__debug_WM_MOUSEMOVE__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6133
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6134
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6135
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6136
    msg = 'WM_MOUSEACTIVATE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6137
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6138
	__debug_WM_MOUSEACTIVATE__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6139
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6140
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6141
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6142
    msg = 'WM_BUTTONUP' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6143
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6144
	__debug_WM_BUTTONUP__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6145
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6146
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6147
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6148
    msg = 'WM_BUTTONDOWN' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6149
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6150
	__debug_WM_BUTTONDOWN__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6151
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6152
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6153
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6154
    msg = 'WM_KEYUP' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6155
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6156
	__debug_WM_KEYUP__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6157
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6158
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6159
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6160
    msg = 'WM_KEYDOWN' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6161
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6162
	__debug_WM_KEYDOWN__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6163
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6164
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6165
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6166
    msg = 'WM_PAINT' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6167
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6168
	__debug_WM_PAINT__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6169
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6170
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6171
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6172
    msg = 'WM_MOVING' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6173
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6174
	__debug_WM_MOVING__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6175
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6176
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6177
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6178
    msg = 'WM_ERASEBKGND' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6179
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6180
	__debug_WM_ERASEBKGND__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6181
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6182
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6183
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6184
    msg = 'WM_SETTEXT' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6185
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6186
	__debug_WM_SETTEXT__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6187
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6188
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6189
    ].
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6190
    msg = 'WM_COPYDATA' ifTrue:[
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6191
%{
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6192
	__debug_WM_COPYDATA__ = (aBoolean == true) ? 1 : 0;
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6193
	RETURN (self);
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6194
%}
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6195
    ].
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6196
    msg = 'WM_DROPFILES' ifTrue:[
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6197
%{
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6198
	__debug_WM_DROPFILES__ = (aBoolean == true) ? 1 : 0;
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6199
	RETURN (self);
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6200
%}
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6201
    ].
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6202
    msg = 'WM_SHOWWINDOW' ifTrue:[
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6203
%{
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6204
	__debug_WM_SHOWWINDOW__ = (aBoolean == true) ? 1 : 0;
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6205
	RETURN (self);
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6206
%}
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6207
    ].
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6208
    msg = 'WM_CHAR' ifTrue:[
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6209
%{
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6210
	__debug_WM_CHAR__ = (aBoolean == true) ? 1 : 0;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6211
	RETURN (self);
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6212
%}
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6213
    ].
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6214
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6215
    "
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6216
     WinWorkstation debug:true
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6217
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6218
     WinWorkstation debug:false message:'WM_KEYUP'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6219
     WinWorkstation debug:false message:'WM_KEYDOWN'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6220
     WinWorkstation debug:false message:'WM_PAINT'
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  6221
     WinWorkstation debug:false message:'WM_BUTTONDOWN'
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6222
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6223
     WinWorkstation debug:true message:'WM_KEYUP'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6224
     WinWorkstation debug:true message:'WM_KEYDOWN'
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6225
     WinWorkstation debug:true message:'WM_CHAR'
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  6226
     WinWorkstation debug:true message:'WM_BUTTONDOWN'
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6227
    "
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  6228
!
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  6229
4248
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6230
debugNative
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6231
%{  /* NOCONTEXT */
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6232
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6233
    RETURN (__debugNative__ == 0 ? false : true);
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6234
%}
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6235
    "
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6236
     WinWorkstation debugNative
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6237
    "
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6238
!
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6239
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6240
debugNative:aBoolean
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6241
%{  /* NOCONTEXT */
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6242
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6243
    __debugNative__ = (aBoolean == true) ? 1 : 0;
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6244
%}
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6245
    "
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6246
     WinWorkstation debugNative:true
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6247
     WinWorkstation debugNative:false
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6248
    "
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6249
!
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6250
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6251
fontHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6252
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6253
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6254
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6255
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6256
    RETURN ( __MKSMALLINT(__cnt_font));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6257
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6258
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6259
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6260
%}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6261
!
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6262
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6263
gcDataHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6264
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6265
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6266
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6267
#ifdef COUNT_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6268
    RETURN ( __MKSMALLINT(__cnt_gcData));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6269
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6270
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6271
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6272
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6273
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6274
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6275
printHandleCounts
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6276
   "show prim values"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6277
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6278
   ('WINWORKSTATION: pW=', self windowHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6279
    'pB=',self bitmapHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6280
    'pGc=',self gcDataHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6281
    'pbmpdc=',self bmpDcHandleCounts printString) errorPrintNL
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6282
!
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6283
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6284
windowHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6285
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6286
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6287
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6288
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6289
    RETURN ( __MKSMALLINT(__cnt_createWindows));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6290
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6291
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6292
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6293
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6294
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6295
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6296
!WinWorkstation class methodsFor:'queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6297
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6298
platformName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6299
    "ST-80 compatibility.
2777
60ba83db1fab comment
Claus Gittinger <cg@exept.de>
parents: 2766
diff changeset
  6300
     Return a string describing the display systems platform.
60ba83db1fab comment
Claus Gittinger <cg@exept.de>
parents: 2766
diff changeset
  6301
     WinWorkstation always returns 'WIN32'."
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6302
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6303
    ^ 'WIN32'
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6304
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6305
    "Modified: 26.5.1996 / 15:32:46 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6306
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6307
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6308
!WinWorkstation methodsFor:'accessing & queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6309
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6310
activateOnClick:aBoolean
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6311
    "set/clear the activateOnClick behavior.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6312
     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
  6313
     the window.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6314
     Windows users typically enable this;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6315
     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
  6316
     it disabled.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6317
     Returns the previous setting.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6318
     The default is true."
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6319
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6320
%{  /* NOCONTEXT */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6321
    OBJ rslt = __activateOnClick ? true : false;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6322
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6323
    if (aBoolean == true) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6324
       __activateOnClick = 1;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6325
    } else {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6326
       if (aBoolean == false) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6327
	   __activateOnClick = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6328
       }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6329
    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6330
    RETURN (rslt);
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6331
%}
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6332
    "
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6333
     Display activateOnClick:true
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6334
     Display activateOnClick:false
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6335
    "
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6336
!
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6337
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6338
anyButtonMotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6339
    "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
  6340
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6341
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6342
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6343
    RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6344
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6345
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6346
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6347
blackpixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6348
    "return the colornumber of black"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6349
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6350
    ^ blackpixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6351
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6352
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6353
button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6354
    "return the state-mask for button1 in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6355
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6356
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6357
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6358
    RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6359
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6360
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6361
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6362
     Display button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6363
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6364
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6365
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6366
button2MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6367
    "return the state-mask for button2 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6368
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6369
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6370
%{  /* NOCONTEXT */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6371
    RETURN (__MKSMALLINT(Button2MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6372
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6373
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6374
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6375
button3MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6376
    "return the state-mask for button3 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6377
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6378
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6379
%{  /* NOCONTEXT */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6380
    RETURN (__MKSMALLINT(Button3MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6381
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6382
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6383
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6384
buttonMotionMask:aButton
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6385
    "return the state-mask for button1 in motion events state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6386
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6387
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6388
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6389
    if (aButton == __MKSMALLINT(1)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6390
	RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6391
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6392
    if (aButton == __MKSMALLINT(2)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6393
	RETURN (__MKSMALLINT(Button2MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6394
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6395
    if (aButton == __MKSMALLINT(3)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6396
	RETURN (__MKSMALLINT(Button3MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6397
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6398
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6399
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6400
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6401
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6402
controlMask
3261
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6403
    "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
  6404
     Obsolete"
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6405
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6406
%{  /* NOCONTEXT */
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6407
    RETURN (__MKSMALLINT(ControlMask));
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6408
%}
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6409
!
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6410
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6411
ctrlModifierMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6412
    "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
  6413
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6414
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6415
    RETURN (__MKSMALLINT(ControlMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6416
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6417
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6418
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6419
defaultEventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6420
    "return a mask to enable some events by default."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6421
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6422
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6423
    RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6424
			 KeyPressMask | KeyReleaseMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6425
			 EnterWindowMask | LeaveWindowMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6426
			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6427
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6428
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6429
5672
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6430
deviceContext
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6431
    ^ rootDC
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6432
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6433
    "Created: / 24-12-2010 / 10:44:40 / cg"
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6434
!
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6435
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6436
displayFileDescriptor
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6437
    "return the displays fileNumber for select, if any"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6438
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6439
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6440
   /* RETURN (nil);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6441
   RETURN ( __MKEXTERNALADDRESS(hInputEvent));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6442
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6443
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6444
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6445
displayName
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6446
    "return the display-connections display name.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6447
     For Windows, a dummy name is returned"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6448
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6449
    ^ 'local'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6450
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6451
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6452
focusFollowsMouse:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6453
    "set/clear the focusFollowsMouse behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6454
     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
  6455
     (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
  6456
      the groups focusView...).
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6457
     Windows users typically disable this;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6458
     users which are used to the X-Window system typically prefer
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6459
     it enabled.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6460
     Returns the previous setting.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6461
     The default is false."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6462
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6463
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6464
    OBJ rslt = __focusFollowsMouse ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6465
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6466
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6467
       __focusFollowsMouse = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6468
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6469
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6470
	   __focusFollowsMouse = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6471
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6472
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6473
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6474
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6475
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6476
     WinWorkstation focusFollowsMouse:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6477
     WinWorkstation focusFollowsMouse:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6478
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6479
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6480
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6481
getSystemColor:aKey
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6482
    "retrieve a windows system color.
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6483
     The styleSheet/View classes may use this to setup default colors"
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6484
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6485
    |rgb|
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6486
4816
114cf20ad4ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4811
diff changeset
  6487
%{
4809
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6488
    int p;
5846
d530b1f9d4a4 setSystemColor
Claus Gittinger <cg@exept.de>
parents: 5843
diff changeset
  6489
    int __rgb, __bgr, r, g, b;
4809
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6490
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6491
    if (aKey == @symbol(COLOR_WINDOW)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6492
      p = COLOR_WINDOW;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6493
    } else if (aKey == @symbol(COLOR_WINDOWTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6494
      p = COLOR_WINDOWTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6495
    } else if (aKey == @symbol(COLOR_MENU)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6496
      p = COLOR_MENU;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6497
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6498
      p = COLOR_MENUTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6499
    } else if (aKey == @symbol(COLOR_BTNFACE)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6500
      p = COLOR_BTNFACE;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6501
    } else if (aKey == @symbol(COLOR_BTNSHADOW)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6502
      p = COLOR_BTNSHADOW;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6503
    } else if (aKey == @symbol(COLOR_BTNTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6504
      p = COLOR_BTNTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6505
    } else if (aKey == @symbol(COLOR_GRAYTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6506
      p = COLOR_GRAYTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6507
    } else if (aKey == @symbol(COLOR_HIGHLIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6508
      p = COLOR_HIGHLIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6509
    } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6510
      p = COLOR_HIGHLIGHTTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6511
    } else if (aKey == @symbol(COLOR_MENU)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6512
      p = COLOR_MENU;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6513
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6514
      p = COLOR_MENUTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6515
    } else if (aKey == @symbol(COLOR_SCROLLBAR)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6516
      p = COLOR_SCROLLBAR;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6517
#ifdef COLOR_SHADOW
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6518
    } else if (aKey == @symbol(COLOR_SHADOW)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6519
      p = COLOR_SHADOW;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6520
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6521
#ifdef COLOR_BACKGROUND
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6522
    } else if (aKey == @symbol(COLOR_BACKGROUND)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6523
      p = COLOR_BACKGROUND;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6524
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6525
#ifdef COLOR_ACTIVECAPTION
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6526
    } else if (aKey == @symbol(COLOR_ACTIVECAPTION)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6527
      p = COLOR_ACTIVECAPTION;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6528
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6529
#ifdef COLOR_INACTIVECAPTION
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6530
    } else if (aKey == @symbol(COLOR_INACTIVECAPTION)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6531
      p = COLOR_INACTIVECAPTION;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6532
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6533
#ifdef COLOR_WINDOWFRAME
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6534
    } else if (aKey == @symbol(COLOR_WINDOWFRAME)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6535
      p = COLOR_WINDOWFRAME;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6536
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6537
#ifdef COLOR_CAPTIONTEXT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6538
    } else if (aKey == @symbol(COLOR_CAPTIONTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6539
      p = COLOR_CAPTIONTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6540
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6541
#ifdef COLOR_ACTIVEBORDER
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6542
    } else if (aKey == @symbol(COLOR_ACTIVEBORDER)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6543
      p = COLOR_ACTIVEBORDER;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6544
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6545
#ifdef COLOR_INACTIVEBORDER
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6546
    } else if (aKey == @symbol(COLOR_INACTIVEBORDER)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6547
      p = COLOR_INACTIVEBORDER;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6548
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6549
#ifdef COLOR_APPWORKSPACE
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6550
    } else if (aKey == @symbol(COLOR_APPWORKSPACE)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6551
      p = COLOR_APPWORKSPACE;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6552
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6553
#ifdef COLOR_INACTIVECAPTIONTEXT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6554
    } else if (aKey == @symbol(COLOR_INACTIVECAPTIONTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6555
      p = COLOR_INACTIVECAPTIONTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6556
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6557
#ifdef COLOR_BTNHIGHLIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6558
    } else if (aKey == @symbol(COLOR_BTNHIGHLIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6559
      p = COLOR_BTNHIGHLIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6560
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6561
#ifdef COLOR_3DDKSHADOW
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6562
    } else if (aKey == @symbol(COLOR_3DDKSHADOW)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6563
      p = COLOR_3DDKSHADOW;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6564
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6565
#ifdef COLOR_3DLIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6566
    } else if (aKey == @symbol(COLOR_3DLIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6567
      p = COLOR_3DLIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6568
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6569
#ifdef COLOR_INFOTEXT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6570
    } else if (aKey == @symbol(COLOR_INFOTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6571
      p = COLOR_INFOTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6572
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6573
#ifdef COLOR_INFOBK
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6574
    } else if (aKey == @symbol(COLOR_INFOBK)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6575
      p = COLOR_INFOBK;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6576
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6577
#ifdef COLOR_HOTLIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6578
    } else if (aKey == @symbol(COLOR_HOTLIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6579
      p = COLOR_HOTLIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6580
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6581
#ifdef COLOR_GRADIENTACTIVECAPTION
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6582
    } else if (aKey == @symbol(COLOR_GRADIENTACTIVECAPTION)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6583
      p = COLOR_GRADIENTACTIVECAPTION;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6584
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6585
#ifdef COLOR_GRADIENTINACTIVECAPTION
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6586
    } else if (aKey == @symbol(COLOR_GRADIENTINACTIVECAPTION)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6587
      p = COLOR_GRADIENTINACTIVECAPTION;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6588
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6589
#ifdef COLOR_DESKTOP
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6590
    } else if (aKey == @symbol(COLOR_DESKTOP)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6591
      p = COLOR_DESKTOP;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6592
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6593
#ifdef COLOR_3DFACE
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6594
    } else if (aKey == @symbol(COLOR_3DFACE)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6595
      p = COLOR_3DFACE;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6596
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6597
#ifdef COLOR_3DSHADOW
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6598
    } else if (aKey == @symbol(COLOR_3DSHADOW)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6599
      p = COLOR_3DSHADOW;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6600
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6601
#ifdef COLOR_3DHIGHLIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6602
    } else if (aKey == @symbol(COLOR_3DHIGHLIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6603
      p = COLOR_3DHIGHLIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6604
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6605
#ifdef COLOR_3DHILIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6606
    } else if (aKey == @symbol(COLOR_3DHILIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6607
      p = COLOR_3DHILIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6608
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6609
#ifdef COLOR_BTNHILIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6610
    } else if (aKey == @symbol(COLOR_BTNHILIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6611
      p = COLOR_BTNHILIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6612
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6613
    } else {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6614
      goto getOutOfHere;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6615
    }
5846
d530b1f9d4a4 setSystemColor
Claus Gittinger <cg@exept.de>
parents: 5843
diff changeset
  6616
    __bgr = GetSysColor(p);
d530b1f9d4a4 setSystemColor
Claus Gittinger <cg@exept.de>
parents: 5843
diff changeset
  6617
4809
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6618
    /* win uses BGR order */
5846
d530b1f9d4a4 setSystemColor
Claus Gittinger <cg@exept.de>
parents: 5843
diff changeset
  6619
    r = __bgr & 0xFF;
d530b1f9d4a4 setSystemColor
Claus Gittinger <cg@exept.de>
parents: 5843
diff changeset
  6620
    g = (__bgr >> 8) & 0xFF;
d530b1f9d4a4 setSystemColor
Claus Gittinger <cg@exept.de>
parents: 5843
diff changeset
  6621
    b = (__bgr >> 16) & 0xFF;
d530b1f9d4a4 setSystemColor
Claus Gittinger <cg@exept.de>
parents: 5843
diff changeset
  6622
4809
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6623
    __rgb = (((r << 8) | g) << 8) | b;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6624
    rgb = __MKSMALLINT(__rgb);
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6625
getOutOfHere: ;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6626
%}.
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6627
    rgb isNil ifTrue:[ ^ nil ].
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6628
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6629
    ^ Color
4816
114cf20ad4ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4811
diff changeset
  6630
	redByte:((rgb bitShift:-16) bitAnd:16rFF)
114cf20ad4ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4811
diff changeset
  6631
	greenByte:((rgb bitShift:-8) bitAnd:16rFF)
114cf20ad4ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4811
diff changeset
  6632
	blueByte:(rgb bitAnd:16rFF)
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6633
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6634
    "
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6635
     Display getSystemColor:#COLOR_WINDOW
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6636
     Display getSystemColor:#COLOR_HIGHLIGHT
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6637
    "
4809
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6638
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6639
    "Modified: / 30-10-2007 / 15:06:02 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6640
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6641
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6642
getSystemMetrics:aNumberOrSymbol
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6643
    "get a system metrics value;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6644
     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
  6645
     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
  6646
     which must be the define-value."
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6647
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6648
%{  /* NOCONTEXT */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6649
    int info = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6650
    int isBool = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6651
    int arg;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6652
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6653
    if (__isSmallInteger(aNumberOrSymbol)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6654
	arg = __intVal(aNumberOrSymbol);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6655
    } else if ((aNumberOrSymbol == @symbol(swapButton)) || (aNumberOrSymbol == @symbol(SM_SWAPBUTTON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6656
	arg = SM_SWAPBUTTON;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6657
	isBool = 1;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6658
    } else if ((aNumberOrSymbol == @symbol(mousePresent)) || (aNumberOrSymbol == @symbol(SM_MOUSEPRESENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6659
	arg = SM_MOUSEPRESENT;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6660
	isBool = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6661
    } else if ((aNumberOrSymbol == @symbol(mouseButtons)) || (aNumberOrSymbol == @symbol(SM_CMOUSEBUTTONS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6662
	arg = SM_CMOUSEBUTTONS;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6663
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6664
	arg = SM_CXICON;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6665
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6666
	arg = SM_CYICON;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  6667
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXDOUBLECLK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6668
	arg = SM_CXDOUBLECLK;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  6669
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYDOUBLECLK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6670
	arg = SM_CYDOUBLECLK;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6671
    } else if ((aNumberOrSymbol == @symbol(cursorWidth)) || (aNumberOrSymbol == @symbol(SM_CXCURSOR))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6672
	arg = SM_CXCURSOR;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6673
    } else if ((aNumberOrSymbol == @symbol(cursorHeight)) || (aNumberOrSymbol == @symbol(SM_CYCURSOR))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6674
	arg = SM_CYCURSOR;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6675
    } else if ((aNumberOrSymbol == @symbol(captionHeight)) || (aNumberOrSymbol == @symbol(SM_CYCAPTION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6676
	arg = SM_CYCAPTION;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6677
    } else if ((aNumberOrSymbol == @symbol(resizeFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6678
	arg = SM_CXFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6679
    } else if ((aNumberOrSymbol == @symbol(resizeFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6680
	arg = SM_CYFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6681
    } else if ((aNumberOrSymbol == @symbol(borderFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXBORDER))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6682
	arg = SM_CXBORDER;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6683
    } else if ((aNumberOrSymbol == @symbol(borderFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYBORDER))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6684
	arg = SM_CYBORDER;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6685
    } else if (aNumberOrSymbol == @symbol(SM_CXDLGFRAME)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6686
	arg = SM_CXDLGFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6687
    } else if (aNumberOrSymbol == @symbol(SM_CYDLGFRAME)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6688
	arg = SM_CYDLGFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6689
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXFULLSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6690
	arg = SM_CXFULLSCREEN;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6691
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYFULLSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6692
	arg = SM_CYFULLSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6693
    } else if ((aNumberOrSymbol == @symbol(screenWidth)) || (aNumberOrSymbol == @symbol(SM_CXSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6694
	arg = SM_CXSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6695
    } else if ((aNumberOrSymbol == @symbol(screenHeight)) || (aNumberOrSymbol == @symbol(SM_CYSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6696
	arg = SM_CYSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6697
    } else if ((aNumberOrSymbol == @symbol(minWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXMIN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6698
	arg = SM_CXMIN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6699
    } else if ((aNumberOrSymbol == @symbol(minWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYMIN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6700
	arg = SM_CYMIN;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6701
    } else if ((aNumberOrSymbol == @symbol(vScrollbarWidth)) || (aNumberOrSymbol == @symbol(SM_CXVSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6702
	arg = SM_CXVSCROLL;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6703
    } else if ((aNumberOrSymbol == @symbol(hScrollbarHeight)) || (aNumberOrSymbol == @symbol(SM_CYHSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6704
	arg = SM_CYHSCROLL;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6705
    } else if ((aNumberOrSymbol == @symbol(vThumbHeight)) || (aNumberOrSymbol == @symbol(SM_CYVTHUMB))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6706
	arg = SM_CYVTHUMB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6707
    } else if ((aNumberOrSymbol == @symbol(hThumbWidth)) || (aNumberOrSymbol == @symbol(SM_CXHTHUMB))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6708
	arg = SM_CXHTHUMB;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6709
    } else if ((aNumberOrSymbol == @symbol(SM_CXSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6710
	arg = SM_CXSIZE;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6711
    } else if ((aNumberOrSymbol == @symbol(SM_CYSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6712
	arg = SM_CYSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6713
    } else if ((aNumberOrSymbol == @symbol(SM_CYVSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6714
	arg = SM_CYVSCROLL;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6715
    } else if ((aNumberOrSymbol == @symbol(SM_CXHSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6716
	arg = SM_CXHSCROLL;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6717
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6718
	arg = SM_CXMINTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6719
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6720
	arg = SM_CYMINTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6721
    } else if ((aNumberOrSymbol == @symbol(SM_CXICONSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6722
	arg = SM_CXICONSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6723
    } else if ((aNumberOrSymbol == @symbol(SM_CYICONSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6724
	arg = SM_CYICONSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6725
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENU))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6726
	arg = SM_CYMENU;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6727
    } else if ((aNumberOrSymbol == @symbol(SM_MENUDROPALIGNMENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6728
	arg = SM_MENUDROPALIGNMENT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6729
    } else if ((aNumberOrSymbol == @symbol(SM_PENWINDOWS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6730
	arg = SM_PENWINDOWS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6731
    } else if ((aNumberOrSymbol == @symbol(SM_DBCSENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6732
	arg = SM_DBCSENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6733
    } else if ((aNumberOrSymbol == @symbol(SM_CXFIXEDFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6734
	arg = SM_CXFIXEDFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6735
    } else if ((aNumberOrSymbol == @symbol(SM_CYFIXEDFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6736
	arg = SM_CYFIXEDFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6737
    } else if ((aNumberOrSymbol == @symbol(SM_CXSIZEFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6738
	arg = SM_CXSIZEFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6739
    } else if ((aNumberOrSymbol == @symbol(SM_CYSIZEFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6740
	arg = SM_CYSIZEFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6741
    } else if ((aNumberOrSymbol == @symbol(SM_CYKANJIWINDOW))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6742
	arg = SM_CYKANJIWINDOW;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6743
    } else if ((aNumberOrSymbol == @symbol(SM_SECURE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6744
	arg = SM_SECURE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6745
    } else if ((aNumberOrSymbol == @symbol(SM_CXEDGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6746
	arg = SM_CXEDGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6747
    } else if ((aNumberOrSymbol == @symbol(SM_CYEDGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6748
	arg = SM_CYEDGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6749
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6750
	arg = SM_CXMINSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6751
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6752
	arg = SM_CYMINSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6753
    } else if ((aNumberOrSymbol == @symbol(SM_CXSMICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6754
	arg = SM_CXSMICON;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6755
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6756
	arg = SM_CYSMICON;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6757
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMCAPTION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6758
	arg = SM_CYSMCAPTION;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6759
    } else if ((aNumberOrSymbol == @symbol(SM_CXSMSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6760
	arg = SM_CXSMSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6761
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6762
	arg = SM_CYSMSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6763
    } else if ((aNumberOrSymbol == @symbol(SM_CXMENUSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6764
	arg = SM_CXMENUSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6765
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENUSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6766
	arg = SM_CYMENUSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6767
    } else if ((aNumberOrSymbol == @symbol(SM_ARRANGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6768
	arg = SM_ARRANGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6769
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6770
	arg = SM_CXMINIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6771
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6772
	arg = SM_CYMINIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6773
    } else if ((aNumberOrSymbol == @symbol(SM_CXMAXTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6774
	arg = SM_CXMAXTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6775
    } else if ((aNumberOrSymbol == @symbol(SM_CYMAXTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6776
	arg = SM_CYMAXTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6777
    } else if ((aNumberOrSymbol == @symbol(SM_CXMAXIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6778
	arg = SM_CXMAXIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6779
    } else if ((aNumberOrSymbol == @symbol(SM_CYMAXIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6780
	arg = SM_CYMAXIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6781
    } else if ((aNumberOrSymbol == @symbol(SM_NETWORK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6782
	arg = SM_NETWORK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6783
    } else if ((aNumberOrSymbol == @symbol(SM_CXDRAG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6784
	arg = SM_CXDRAG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6785
    } else if ((aNumberOrSymbol == @symbol(SM_CYDRAG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6786
	arg = SM_CYDRAG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6787
    } else if ((aNumberOrSymbol == @symbol(SM_NETWORK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6788
	arg = SM_NETWORK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6789
    } else if ((aNumberOrSymbol == @symbol(SM_SHOWSOUNDS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6790
	arg = SM_SHOWSOUNDS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6791
    } else if ((aNumberOrSymbol == @symbol(SM_CXMENUCHECK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6792
	arg = SM_CXMENUCHECK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6793
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENUCHECK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6794
	arg = SM_CYMENUCHECK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6795
    } else if ((aNumberOrSymbol == @symbol(SM_SLOWMACHINE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6796
	arg = SM_SLOWMACHINE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6797
    } else if ((aNumberOrSymbol == @symbol(SM_MIDEASTENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6798
	arg = SM_MIDEASTENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6799
    } else if ((aNumberOrSymbol == @symbol(SM_MOUSEWHEELPRESENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6800
	arg = SM_MOUSEWHEELPRESENT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6801
    } else if ((aNumberOrSymbol == @symbol(SM_XVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6802
	arg = SM_XVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6803
    } else if ((aNumberOrSymbol == @symbol(SM_YVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6804
	arg = SM_YVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6805
    } else if ((aNumberOrSymbol == @symbol(SM_CXVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6806
	arg = SM_CXVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6807
    } else if ((aNumberOrSymbol == @symbol(SM_CYVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6808
	arg = SM_CYVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6809
    } else if ((aNumberOrSymbol == @symbol(SM_CMONITORS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6810
	arg = SM_CMONITORS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6811
    } else if ((aNumberOrSymbol == @symbol(SM_SAMEDISPLAYFORMAT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6812
	arg = SM_SAMEDISPLAYFORMAT;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6813
#ifdef SM_IMMENABLED
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6814
    } else if ((aNumberOrSymbol == @symbol(SM_IMMENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6815
	arg = SM_IMMENABLED;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6816
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6817
    } else if ((aNumberOrSymbol == @symbol(SM_DEBUG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6818
	arg = SM_DEBUG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6819
#ifdef SM_REMOTESESSION
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6820
    } else if ((aNumberOrSymbol == @symbol(SM_REMOTESESSION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6821
	arg = SM_REMOTESESSION;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6822
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6823
    } else {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6824
	RETURN (nil);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6825
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6826
    info = GetSystemMetrics(arg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6827
    if (isBool) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6828
	RETURN (info ? true : false);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6829
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6830
    RETURN (__MKSMALLINT(info));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6831
%}
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6832
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6833
     Screen current getSystemMetrics:#SM_MOUSEWHEELPRESENT
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6834
     Screen current getSystemMetrics:#SM_ARRANGE
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6835
     Screen current getSystemMetrics:#SM_XVIRTUALSCREEN
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6836
     Screen current getSystemMetrics:#SM_CXVIRTUALSCREEN
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6837
     Screen current getSystemMetrics:#SM_CYVIRTUALSCREEN
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6838
     Screen current getSystemMetrics:#SM_CMONITORS
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6839
     Screen current getSystemMetrics:#SM_SAMEDISPLAYFORMAT
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  6840
     Screen current getSystemMetrics:81
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6841
    "
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6842
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6843
    "Modified: / 08-09-2006 / 15:36:32 / cg"
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6844
!
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6845
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6846
getSystemParametersInfo:aNumberOrSymbol
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6847
    "get a system parameter value;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6848
     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
  6849
     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
  6850
     which must be the define-value."
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6851
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6852
    | info menuFontInfoArray statusFontInfoArray messageFontInfoArray
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6853
      menuFont statusFont messageFont |
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6854
%{
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6855
    int retVal = 0;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6856
    int isBool = 0;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6857
    int isString = 0;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6858
    int isRect = 0;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6859
    int isNonClientInfo = 0;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6860
    int arg, param;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6861
    void *pRslt;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6862
    union {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6863
	char buffer[1024];
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6864
	RECT rect;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6865
	NONCLIENTMETRICS nc;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6866
    } rslt;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6867
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6868
    if (__isSmallInteger(aNumberOrSymbol)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6869
	arg = __intVal(aNumberOrSymbol);
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6870
#ifdef SPI_GETDESKWALLPAPER
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6871
    } else if (aNumberOrSymbol == @symbol(SPI_GETDESKWALLPAPER)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6872
	arg = SPI_GETDESKWALLPAPER;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6873
	isString = 1;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6874
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6875
#ifdef SPI_GETDROPSHADOW
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6876
    } else if (aNumberOrSymbol == @symbol(SPI_GETDROPSHADOW)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6877
	arg = SPI_GETDROPSHADOW;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6878
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6879
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6880
#ifdef SPI_GETFLATMENU
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6881
    } else if (aNumberOrSymbol == @symbol(SPI_GETFLATMENU)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6882
	arg = SPI_GETFLATMENU;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6883
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6884
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6885
#ifdef SPI_GETWHEELSCROLLLINES
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6886
    } else if (aNumberOrSymbol == @symbol(SPI_GETWHEELSCROLLLINES)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6887
	arg = SPI_GETWHEELSCROLLLINES;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6888
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6889
#ifdef SPI_GETHOTTRACKING
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6890
    } else if (aNumberOrSymbol == @symbol(SPI_GETHOTTRACKING)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6891
	arg = SPI_GETHOTTRACKING;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6892
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6893
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6894
#ifdef SPI_GETTOOLTIPANIMATION
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6895
    } else if (aNumberOrSymbol == @symbol(SPI_GETTOOLTIPANIMATION)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6896
	arg = SPI_GETTOOLTIPANIMATION;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6897
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6898
#endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6899
#ifdef SPI_GETWORKAREA
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6900
    } else if (aNumberOrSymbol == @symbol(SPI_GETWORKAREA)) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6901
	arg = SPI_GETWORKAREA;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6902
	isRect = 1;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6903
#endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6904
#ifdef SPI_GETNONCLIENTMETRICS
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6905
    } else if (aNumberOrSymbol == @symbol(SPI_GETNONCLIENTMETRICS)) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6906
	arg = SPI_GETNONCLIENTMETRICS;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6907
	rslt.nc.cbSize = sizeof ( rslt.nc ) ;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6908
	isNonClientInfo = 1;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6909
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6910
    } else {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6911
	RETURN (nil);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6912
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6913
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6914
    param = 0;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6915
    pRslt = (void *)&rslt;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6916
    if (isString) {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6917
	param = sizeof(rslt);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6918
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6919
    retVal = SystemParametersInfo(arg, param, pRslt, 0);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6920
    if (! retVal) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6921
	RETURN (nil);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6922
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6923
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6924
    if (isBool) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6925
	RETURN (info ? true : false);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6926
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6927
    if (isString) {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6928
	RETURN (__MKSTRING(rslt.buffer));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6929
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6930
    if (isRect) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6931
	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
  6932
			__MKSMALLINT(rslt.rect.left),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6933
			__MKSMALLINT(rslt.rect.top),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6934
			__MKSMALLINT(rslt.rect.right),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6935
			__MKSMALLINT(rslt.rect.bottom)) );
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6936
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6937
    if (isNonClientInfo) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6938
	menuFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfMenuFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6939
	statusFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfStatusFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6940
	messageFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfMessageFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6941
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6942
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6943
   out: ;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6944
%}.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6945
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6946
    menuFontInfoArray notNil ifTrue:[
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6947
	menuFont := self fontDescriptionFromLogicalFontInfoArray:menuFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6948
	statusFont := self fontDescriptionFromLogicalFontInfoArray:statusFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6949
	messageFont := self fontDescriptionFromLogicalFontInfoArray:messageFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6950
	^ (Dictionary new)
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6951
	    at:#menuFont put:menuFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6952
	    at:#statusFont put:statusFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6953
	    at:#messageFont put:messageFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6954
	    yourself.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6955
    ].
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6956
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6957
    ^ nil
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6958
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6959
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6960
     Screen current getSystemParametersInfo:#SPI_GETDESKWALLPAPER
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6961
     Screen current getSystemParametersInfo:#SPI_GETDROPSHADOW
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6962
     Screen current getSystemParametersInfo:#SPI_GETFLATMENU
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6963
     Screen current getSystemParametersInfo:#SPI_GETWHEELSCROLLLINES
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6964
     Screen current getSystemParametersInfo:#SPI_GETHOTTRACKING
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6965
     Screen current getSystemParametersInfo:#SPI_GETTOOLTIPANIMATION
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6966
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6967
     Screen current getSystemParametersInfo:#SPI_GETWORKAREA
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6968
     Screen current getSystemParametersInfo:#SPI_GETNONCLIENTMETRICS
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6969
    "
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6970
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6971
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6972
ignoreButtonPressOnActivate:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6973
    "set/clear the ignoreButtonPressOnActivate behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6974
     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
  6975
     and not passed to the window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6976
     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
  6977
     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
  6978
     activation.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6979
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6980
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6981
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6982
    OBJ rslt = __ignoreButtonPressOnActivate ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6983
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6984
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6985
       __ignoreButtonPressOnActivate = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6986
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6987
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6988
	   __ignoreButtonPressOnActivate = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6989
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6990
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6991
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6992
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6993
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6994
     WinWorkstation ignoreButtonPressOnActivate:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6995
     WinWorkstation ignoreButtonPressOnActivate:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6996
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6997
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6998
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  6999
monitorInfoFor:aMonitorId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7000
    "given a monitor handle (as returned by monitorHandleForXXX), return its info"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7001
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7002
    |screenL screenT screenR screenB screenW screenH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7003
     workL workT workR workB workW workH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7004
     isPrimary mName|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7005
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7006
    if (__isExternalAddress(aMonitorId)) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7007
	HMONITOR hMonitor = _HWNDVal(aMonitorId);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7008
	MONITORINFOEX info;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7009
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7010
	info.cbSize = sizeof(MONITORINFOEX);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7011
#if 0
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  7012
	/* the following is only needed when we want
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  7013
	 * to support very old NT/W95/W98 systems; we don't !
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  7014
	 */
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7015
	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
  7016
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7017
	if (P_GetMonitorInfo == 0) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7018
	    HINSTANCE hUser = LoadLibrary("user32.dll");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7019
	    // 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
  7020
	    if (hUser) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7021
		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
  7022
				    GetProcAddress(hUser, "GetMonitorInfo");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7023
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7024
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7025
	console_printf("P_GetMonitorInfo: %x\n", P_GetMonitorInfo);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7026
	if ((*P_GetMonitorInfo)(hMonitor, &info))
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7027
#else
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7028
	if (GetMonitorInfo(hMonitor, &info))
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7029
#endif
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7030
	{
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7031
	    // 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
  7032
	    screenL = __MKSMALLINT(info.rcMonitor.left);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7033
	    screenT = __MKSMALLINT(info.rcMonitor.top);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7034
	    screenR = __MKSMALLINT(info.rcMonitor.right);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7035
	    screenB = __MKSMALLINT(info.rcMonitor.bottom);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7036
	    workL = __MKSMALLINT(info.rcWork.left);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7037
	    workT = __MKSMALLINT(info.rcWork.top);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7038
	    workR = __MKSMALLINT(info.rcWork.right);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7039
	    workB = __MKSMALLINT(info.rcWork.bottom);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7040
	    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
  7041
	    info.szDevice[31] = '\0';
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7042
	    mName = __MKSTRING(info.szDevice);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7043
	}
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7044
    }
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7045
%}.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7046
    screenL isNil ifTrue:[ ^ nil ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7047
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7048
    ^ MonitorInfo new
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7049
	screenX:screenL screenY:screenT
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7050
	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
  7051
	workX:workL workY:workT
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7052
	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
  7053
	isPrimary:isPrimary
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7054
	name:mName
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7055
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7056
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7057
     Screen current monitorInfoFor:(Screen current monitorHandleForView:(Transcript topView id))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7058
     Screen current monitorInfoFor:(Screen current monitorHandleForPoint:(0@0))
5549
fd4fc69df52d fixed: #monitorHandleForPoint:
Claus Gittinger <cg@exept.de>
parents: 5546
diff changeset
  7059
     Screen current monitorInfoFor:(Screen current monitorHandleForPoint:(Display pointFromUser))
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7060
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7061
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7062
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7063
primViewIdFromPoint:aPoint in:windowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7064
    "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
  7065
     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
  7066
     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
  7067
     - 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
  7068
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7069
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7070
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7071
    OBJ xp, yp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7072
    int xpos, ypos;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7073
    HWND child_ret;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7074
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7075
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7076
     && __isExternalAddress(windowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7077
     && __isPoint(aPoint))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7078
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7079
	xp = _point_X(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7080
	yp = _point_Y(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7081
	if (__bothSmallInteger(xp, yp))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7082
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7083
	    POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7084
	    HWND hWnd = _HWNDVal(windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7085
	    p.x = __intVal(xp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7086
	    p.y = __intVal(yp);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7087
	    ScreenToClient(hWnd, &p);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7088
	    child_ret = ChildWindowFromPointEx(hWnd,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7089
	    /*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
  7090
	    if ((child_ret) && (child_ret != hWnd))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7091
	    {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7092
		RETURN ( __MKEXTERNALADDRESS(child_ret) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7093
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7094
	    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7095
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7096
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7097
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7098
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7099
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7100
prim_getWindowRect:hWnd
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7101
    |l r t b|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7102
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7103
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7104
    if (__isExternalAddress(hWnd) || __isExternalBytesLike(hWnd)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7105
	HANDLE _hwnd = __externalAddressVal(hWnd);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7106
	RECT rect;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7107
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7108
	if (GetWindowRect(_hwnd, &rect)) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7109
	    l = __MKSMALLINT(rect.left);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7110
	    r = __MKSMALLINT(rect.right);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7111
	    t = __MKSMALLINT(rect.top);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7112
	    b = __MKSMALLINT(rect.bottom);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7113
	}
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7114
    }
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7115
%}.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7116
    l isNil ifTrue:[
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7117
	self primitiveFailed.
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7118
    ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7119
    ^ l@t corner:r@b
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7120
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7121
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7122
protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7123
    "return the displays protocol version.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7124
     For Windows, a dummy number is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7125
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7126
    ^ '1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7127
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7128
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7129
     Display protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7130
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7131
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7132
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7133
rightButtonIsLowerWindow:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7134
    "set/clear the rightButtonIsLowerWindow behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7135
     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
  7136
     window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7137
     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
  7138
     and not provided by the standard windows applications.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7139
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7140
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7141
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7142
    OBJ rslt = __rightButtonIsLowerWindow ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7143
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7144
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7145
       __rightButtonIsLowerWindow = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7146
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7147
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7148
	   __rightButtonIsLowerWindow = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7149
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7150
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7151
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7152
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7153
    "
5440
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7154
     Display rightButtonIsLowerWindow:true
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7155
     Display rightButtonIsLowerWindow:false
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7156
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7157
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7158
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7159
serverVendor
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7160
    "return the server vendor string.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7161
     For Windows, a dummy name is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7162
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7163
    ^ 'microsoft'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7164
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7165
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7166
     Display serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7167
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7168
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7169
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7170
shiftMask
3261
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7171
    "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
  7172
     Obsolete"
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7173
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7174
%{  /* NOCONTEXT */
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7175
    RETURN (__MKSMALLINT(ShiftMask));
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7176
%}
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7177
!
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7178
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7179
shiftModifierMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7180
    "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
  7181
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7182
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7183
    RETURN (__MKSMALLINT(ShiftMask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7184
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7185
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7186
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7187
shiftedLeftButtonIsLowerWindow:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7188
    "set/clear the shiftedLeftButtonIsLowerWindow behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7189
     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
  7190
     window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7191
     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
  7192
     and not provided by the standard windows applications.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7193
     Notice, this duplicates the rightButtonIsLowerWindow behavior,
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7194
     but is useful with single-button mice.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7195
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7196
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7197
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7198
    OBJ rslt = __shiftedLeftButtonIsLowerWindow ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7199
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7200
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7201
       __shiftedLeftButtonIsLowerWindow = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7202
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7203
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7204
	   __shiftedLeftButtonIsLowerWindow = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7205
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7206
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7207
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7208
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7209
    "
5440
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7210
     Display shiftedLeftButtonIsLowerWindow:true
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7211
     Display shiftedLeftButtonIsLowerWindow:false
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7212
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7213
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7214
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7215
supportedSystemColorKeys
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7216
    "return a collection of supported systemColor keys"
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7217
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7218
    ^#(
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7219
	COLOR_WINDOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7220
	COLOR_WINDOWTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7221
	COLOR_MENU
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7222
	COLOR_MENUTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7223
	COLOR_BTNFACE
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7224
	COLOR_BTNSHADOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7225
	COLOR_BTNTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7226
	COLOR_GRAYTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7227
	COLOR_HIGHLIGHT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7228
	COLOR_HIGHLIGHTTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7229
	COLOR_MENU
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7230
	COLOR_MENUTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7231
	COLOR_SCROLLBAR
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7232
	COLOR_SHADOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7233
    )
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7234
!
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7235
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7236
translatePoint:aPoint from:windowId1 to:windowId2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7237
    "given a point in window1, return the coordinate in window2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7238
     This expects a device coordinate (relative to the first views origin)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7239
     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
  7240
     - use to xlate points from a window to rootwindow"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7241
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7242
    |x1 y1 x2 y2|
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7243
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7244
    x1 := x2 := aPoint x truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7245
    y1 := y2 := aPoint y truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7246
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7247
%{
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7248
    HWND w1, w2;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7249
    POINT point;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7250
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7251
    if (__isExternalAddress(windowId1)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7252
     && __isExternalAddress(windowId2)
2279
30a35be06995 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2276
diff changeset
  7253
     && __bothSmallInteger(x1, y1)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7254
	w1 = _HWNDVal(windowId1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7255
	w2 = _HWNDVal(windowId2);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7256
	point.x = __intVal(x1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7257
	point.y = __intVal(y1);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7258
	CPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y));
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7259
	if (ClientToScreen(w1,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7260
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7261
	}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7262
	if (ScreenToClient(w2,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7263
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7264
	}
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7265
	CPRINTF((" %x %d/%d\n",w2,point.x,point.y));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7266
	RETURN (__MKPOINT_INT(point.x, point.y));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7267
    }
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7268
    RETURN (nil);
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7269
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7270
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7271
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7272
vendorRelease
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7273
    "return the display-servers vendor release
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7274
     - should normally not be of any interest,
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7275
     but may be usefule for special cases.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7276
     (to avoid bugs in certain implementations / releases)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7277
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7278
    ^ 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7279
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7280
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7281
     Display vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7282
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7283
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7284
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7285
viewIdFromPoint:aPoint in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7286
    "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
  7287
     hit by this coordinate. Return nil if no view was hit.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7288
     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
  7289
     - 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
  7290
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7291
    windowId notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7292
	aPoint isPoint ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7293
	    "/(aPoint x > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7294
	    "/(aPoint y > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7295
	    "/aPoint printString errorPrintCR.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7296
	    ^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7297
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7298
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7299
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7300
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7301
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7302
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7303
whitepixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7304
    "return the colornumber of white"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7305
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7306
    ^ whitepixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7307
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7308
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7309
!WinWorkstation methodsFor:'accessing display capabilities'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7310
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7311
captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7312
    "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
  7313
     standard topWindows."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7314
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7315
    ^ self getSystemMetrics:#SM_CYCAPTION
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7316
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7317
    "Modified: / 08-09-2006 / 15:39:24 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7318
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7319
5672
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7320
getDeviceCaps:hdc index:index
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7321
    <apicall: int "GetDeviceCaps" (handle int) module: "gdi32.dll" >
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7322
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7323
    "Created: / 24-12-2010 / 11:14:59 / cg"
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7324
!
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7325
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7326
iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7327
    "Get the preferred/supported icon sizes."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7328
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7329
    |d w h|
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7330
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7331
    w := self getSystemMetrics:#SM_CXICON.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7332
    h := self getSystemMetrics:#SM_CYICON.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7333
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7334
    d := IdentityDictionary new.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7335
    d at:#minWidth put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7336
    d at:#maxWidth put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7337
    d at:#widthStep put:1.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7338
    d at:#minHeight put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7339
    d at:#maxHeight put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7340
    d at:#heightStep put:1.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7341
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7342
    ^ OrderedCollection with:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7343
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7344
    "
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7345
     Display iconSizes
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7346
    "
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7347
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7348
    "Modified: / 08-09-2006 / 15:40:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7349
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7350
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7351
monitorBoundsAt:aPoint
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7352
    "answer the bounds of the monitor the point is contained in"
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7353
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7354
    |monitorHandle monitorInfo|
5607
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7355
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7356
    self numberOfMonitors > 1 ifTrue:[
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7357
	"/ ******* MULTI SCREEN ******
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7358
	monitorHandle := self monitorHandleForPoint:aPoint.
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7359
	monitorHandle notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7360
	    monitorInfo := self monitorInfoFor:monitorHandle.
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7361
	    monitorInfo notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7362
		^ monitorInfo bounds
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7363
	    ].
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7364
	].
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7365
    ].
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7366
    ^ super monitorBoundsAt:aPoint
5621
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7367
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7368
    "
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7369
     Display monitorBoundsAt:100@100
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7370
     Display monitorBoundsAt:2000@100
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7371
     Display monitorBoundsAt:-200@100
5607
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7372
    "
5621
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7373
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7374
    "Modified: / 22-10-2010 / 10:55:59 / cg"
5607
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7375
!
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7376
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7377
numberOfMonitors
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7378
    ^ self getSystemMetrics:#SM_CMONITORS
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7379
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7380
    "
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7381
     Display numberOfMonitors
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7382
    "
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7383
!
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7384
5640
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7385
pointIsVisible:aPoint
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7386
    "is the point visible?"
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7387
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7388
    ^ (self monitorHandleForPoint:aPoint) notNil
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7389
!
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7390
5637
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7391
pointsAreOnSameMonitor:point1 and:point2
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7392
    "are the two points on the same (multi-screen) monitors?"
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7393
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7394
    ^ (self monitorHandleForPoint:point1) = (self monitorHandleForPoint:point2)
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7395
!
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7396
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7397
preferredIconSize
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7398
    "Get the preferrered icon size.
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7399
     Here, workaround windows (bug?) which returns 32@32
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7400
     although, 20@20 is much nicer"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7401
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7402
    ^ 20@20
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7403
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7404
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7405
     Display preferredIconSize
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7406
    "
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7407
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7408
    "Modified: / 28.9.1998 / 13:49:54 / cg"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7409
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7410
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7411
scrollsAsynchronous
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7412
    "return true, if this display asynchronously sends expose events after a
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7413
     scroll operation. False otherwise. Asynchronous expose events are an X
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7414
     speciality, which affects a few methods outside of the display class (sorry)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7415
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7416
    ^ true "/ false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7417
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7418
5866
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7419
smallestMonitorHeight
5867
f6b5ce37a2a5 comment/format in: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5866
diff changeset
  7420
    "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
  7421
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7422
    |info minH|
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7423
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7424
    minH := self usableHeight.
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7425
    self monitorHandles do:[:eachHandle |
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
  7426
	info := self monitorInfoFor:eachHandle.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
  7427
	info notNil ifTrue:[ minH := minH min: info workHeight ].
5866
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7428
    ].
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7429
    ^ minH
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7430
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7431
    "
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7432
     Display smallestMonitorHeight
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7433
    "
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7434
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7435
    "Modified: / 22-10-2010 / 15:34:44 / cg"
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7436
!
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7437
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7438
supportedImageFormats
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7439
    "return an array with supported image formats; each array entry
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7440
     is another array, consisting of depth and bitsPerPixel values."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7441
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7442
    |info|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7443
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7444
    info := IdentityDictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7445
    info at:#depth put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7446
    info at:#bitsPerPixel put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7447
    info at:#padding put:32.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7448
    ^ Array with:info
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7449
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7450
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7451
     Disply supportedImageFormats
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7452
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7453
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7454
    "Modified: / 10.9.1998 / 23:14:05 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7455
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7456
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7457
supportsDeepIcons
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7458
    "return true, if this device supports deepicons."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7459
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7460
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7461
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7462
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7463
supportsIconMasks
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7464
    "return true, if this device supports masked icons.
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7465
     For now, return false since somehow icons are inverted
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7466
     if we use masks (and I dont know yet why)."
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7467
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7468
    ^ false
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7469
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7470
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7471
     Display supportsIconMasks
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7472
    "
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7473
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7474
    "Modified: / 28.4.1999 / 19:59:17 / cg"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7475
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7476
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7477
supportsIconViews
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7478
    "return true, if this device supports views as icons."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7479
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7480
    ^ false "/ true
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7481
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7482
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7483
     Display supportsIconViews
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7484
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7485
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7486
    "Modified: 10.6.1996 / 20:11:48 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7487
    "Created: 10.6.1996 / 21:08:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7488
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7489
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7490
supportsMaskedDrawingWith:aForm
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7491
    "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
  7492
     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
  7493
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  7494
    ^ true
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7495
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7496
    "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
  7497
    "Modified: / 4.5.1999 / 12:58:31 / cg"
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  7498
!
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  7499
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7500
supportsViewBackgroundPixmap:aForm
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7501
    "return true, if the device allows the given pixmap as
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7502
     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
  7503
     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
  7504
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  7505
    ^ true
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7506
!
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7507
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7508
supportsWindowBorder:aNumber
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7509
    "return true, if this device supports bordered windows.
3109
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7510
     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
  7511
     to be supported by the device.
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7512
     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
  7513
     future. (Windows only supports borders 1 and noBorder)"
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7514
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7515
    ^ (aNumber ? 0) <= 1
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7516
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7517
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7518
     Display supportsWindowBorder:1
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7519
    "
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7520
!
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7521
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7522
usableExtent
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7523
    "return the usable extent of the display (in pixels).
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7524
     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
  7525
     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
  7526
     or bigger, in case of multi-screen systems"
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7527
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7528
    |wSingle hSingle w h dx dy|
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7529
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7530
    w := wSingle := self getSystemMetrics:#SM_CXFULLSCREEN.
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7531
    h := hSingle := self getSystemMetrics:#SM_CYFULLSCREEN.
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7532
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7533
    (self numberOfMonitors) > 1 ifTrue:[
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7534
	w := self getSystemMetrics:#SM_CXVIRTUALSCREEN.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7535
	h := self getSystemMetrics:#SM_CYVIRTUALSCREEN.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7536
	(w isNil or:[h isNil]) ifTrue:[
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7537
	    "/ not supported under win95 and win-nt4 - fallback to real extent
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7538
	    w := wSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7539
	    h := hSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7540
	] ifFalse:[
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7541
	    dx := (self getSystemMetrics:#SM_CXSCREEN) - wSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7542
	    dy := (self getSystemMetrics:#SM_CYSCREEN) - hSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7543
	    w := w - dx.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7544
	    h := h - dy - 8.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7545
	].
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7546
    ].
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7547
    ^ w @ h.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7548
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7549
    "
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7550
     Display usableExtent
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7551
     Display getSystemMetrics:#SM_CYVIRTUALSCREEN
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7552
     Display getSystemMetrics:#SM_CYFULLSCREEN
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7553
     Display getSystemMetrics:#SM_CYSCREEN
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7554
     Display getSystemMetrics:#SM_CMONITORS
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7555
    "
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7556
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7557
    "Modified: / 08-09-2006 / 18:19:22 / cg"
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7558
!
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7559
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7560
usableHeightAt:aPoint
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7561
    "returns the usable height of the display (in pixels) at a given point
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7562
     Normally, the same as height, but may be smaller, in
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7563
     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
  7564
     On multi-display systems with different sized screens, this should care for
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7565
     which display is at the given x-position"
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7566
5943
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7567
    |info fullHeight usableHeight delta|
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7568
5630
a690d4635014 changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5621
diff changeset
  7569
    true "(self numberOfMonitors) > 1" ifTrue:[
5943
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7570
        "/ ******* MULTI SCREEN ******
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7571
        info := self monitorInfoFor:(self monitorHandleForPoint:aPoint).
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7572
        info notNil ifTrue:[ 
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7573
            fullHeight := self getSystemMetrics:#SM_CYVIRTUALSCREEN.   
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7574
            usableHeight := self getSystemMetrics:#SM_CYFULLSCREEN.  "/ without any start-menu bar
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7575
            delta := fullHeight - usableHeight.
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7576
            ^ info workHeight - delta 
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7577
        ].
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7578
    ].
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7579
    ^ self usableHeight
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7580
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7581
    "
5943
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7582
     Display numberOfMonitors
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7583
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7584
     Display usableHeight
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7585
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7586
     Display usableHeightAt:100@100  
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7587
     Display usableHeightAt:2000@100  
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7588
     Display usableHeightAt:-200@100
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7589
    "
5621
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7590
5943
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7591
    "Modified (comment): / 27-10-2012 / 13:34:32 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7592
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7593
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7594
!WinWorkstation methodsFor:'bitmap/window creation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7595
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7596
addMenuItemWithLabel:aString toWindowID:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7597
    "not yet"
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7598
%{
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7599
#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
  7600
    if (__isExternalAddress(aWindowId)) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7601
	HWND hWin = _HWNDVal(aWindowId);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7602
	HMENU hMenu;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7603
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7604
	hMenu = GetMenu(hWin);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7605
	if (hMenu) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7606
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7607
	}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7608
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7609
#endif
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7610
%}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7611
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7612
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7613
createBitmapFromArray:anArray width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7614
    |bitmapId|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7615
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7616
    bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7617
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7618
    bitmapId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7619
	'WINWORKSTATION: cannot create bitmap' errorPrintCR.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7620
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7621
    ^ bitmapId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7622
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7623
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7624
createBitmapWidth:w height:h
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7625
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7626
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7627
    HANDLE newBitmapHandle;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7628
    int b_width, b_height;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7629
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7630
    if (__bothSmallInteger(w, h)) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7631
	b_width = __intVal(w);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7632
	b_height = __intVal(h);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7633
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7634
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7635
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7636
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7637
	    __cnt_bitmap++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7638
	    RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle, __cnt_bitmap));
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7639
#endif
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7640
	    RETURN ( __MKOBJ(newBitmapHandle));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7641
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7642
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7643
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7644
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7645
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7646
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7647
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7648
createPixmapWidth:w height:h depth:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7649
    "allocate a pixmap on the Xserver, the contents is undefined
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7650
     (i.e. random). Return a bitmap id or nil"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7651
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7652
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7653
    HANDLE newBitmapHandle;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7654
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7655
    /*console_printf("CreateBitmap Color\n");*/
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7656
    if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7657
	if (__intVal(d) == 1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7658
	    newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7659
	} else {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7660
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7661
	    if (__intVal(d) != __depth) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7662
		console_printf("invalid depth\n");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7663
		RETURN (nil);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7664
	    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7665
#endif
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7666
	    newBitmapHandle = CreateCompatibleBitmap(__rootDC, __intVal(w), __intVal(h) );
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7667
	}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7668
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7669
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7670
#ifdef COUNT_BMP_RESOURCES
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7671
	    __cnt_bitmap++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7672
	    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
  7673
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7674
	    RETURN ( __MKOBJ(newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7675
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7676
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7677
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7678
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7679
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7680
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7681
1467
9629ce710c53 added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  7682
createWindowFor:aView type:typeSymbol
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7683
		 origin:origin
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7684
		 extent:extent
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7685
		 minExtent:minExt
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7686
		 maxExtent:maxExt
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7687
		 borderWidth:bWidth
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7688
		 subViewOf:wsuperView
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7689
		 style:wStyle
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7690
		 inputOnly:winputOnly
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7691
		 label:wlabel
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7692
		 owner:wowner
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7693
		 icon:wicon
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7694
		 iconMask:wiconMaskArg
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7695
		 iconView:wiconView
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7696
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7697
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7698
    |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight
4326
2c828f8b5173 fixed iconMask
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  7699
     wsuperViewId wiconId wiconMask invertedWiconMask wiconMaskId windowId
2c828f8b5173 fixed iconMask
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  7700
     weventMask wiconWidth wiconHeight windowType windowClass moreArgs|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7701
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7702
    "/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7703
    "/  preferredVisual preferredDepth  viewGravity wcursorId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7704
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7705
    displayId isNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7706
	self primitiveFailed.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7707
	^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7708
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7709
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7710
    origin notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7711
	xpos := origin x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7712
	ypos := origin y.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7713
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7714
	xpos := ypos := 0.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7715
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7716
    extent notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7717
	wwidth := extent x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7718
	wheight := extent y.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7719
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7720
	wwidth := 100.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7721
	wheight := 40.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7722
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7723
    minExt notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7724
	minWidth := minExt x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7725
	minHeight := minExt y
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7726
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7727
	minWidth := 1.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7728
	minHeight := 1.
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7729
    ].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7730
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7731
    maxExt notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7732
	maxWidth := maxExt x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7733
	maxHeight := maxExt y
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7734
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7735
	"/ this is not really a good idea
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7736
	"/ maxWidth := width.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7737
	"/ maxHeight := height.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7738
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7739
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7740
    wsuperView notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7741
	wsuperViewId := wsuperView id
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7742
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7743
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7744
    wicon notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7745
	wiconId := wicon id.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7746
	wiconHeight := wicon height.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7747
	wiconWidth  := wicon width.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7748
	wiconMask := wiconMaskArg.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7749
	wiconMask isNil ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7750
	    wiconMask := wicon mask.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7751
	].
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7752
	wiconMask notNil ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7753
	    "/ WIN32's mask has zeros for opaque pixels
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7754
	    invertedWiconMask := wiconMask copy.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7755
	    invertedWiconMask bits invert.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7756
	    invertedWiconMask := invertedWiconMask onDevice:self.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7757
	    wiconMaskId := invertedWiconMask id
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7758
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7759
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7760
"/    wiconView notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7761
"/        wiconViewId := wiconView id
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7762
"/    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7763
    weventMask := aView eventMask.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7764
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  7765
    NativeWidgets ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7766
	windowType := aView nativeWindowType.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7767
	windowType notNil ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7768
	    "/ must be a symbol and is used
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7769
	    "/ as a key into the nativeClass translation map.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7770
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7771
	    windowClass := NativeWidgetClassTable at:windowType ifAbsent:windowType.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7772
	    self class debugNative ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7773
		'WinWorkstation [info]: windowType: ' infoPrint. windowType infoPrint.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7774
		' windowClass: ' infoPrint. windowClass infoPrintCR.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7775
	    ].
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7776
	].
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7777
    ].
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7778
    aView isMDIClientView ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7779
	windowClass := 'mdiclient'.
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7780
    ].
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7781
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7782
    windowClass notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7783
	aView beNativeWidget.
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7784
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7785
	aView beNonNativeWidget.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7786
    ].
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7787
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7788
    moreArgs := Array new:20.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7789
    moreArgs at:1 put:xpos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7790
    moreArgs at:2 put:ypos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7791
    moreArgs at:3 put:wwidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7792
    moreArgs at:4 put:wheight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7793
    moreArgs at:5 put:minWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7794
    moreArgs at:6 put:minHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7795
    moreArgs at:7 put:maxWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7796
    moreArgs at:8 put:maxHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7797
    moreArgs at:9 put:wsuperViewId.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7798
    moreArgs at:10 put:nil. "/ wcursorId.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7799
    moreArgs at:11 put:wiconId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7800
    moreArgs at:12 put:wiconMaskId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7801
    moreArgs at:13 put:wiconWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7802
    moreArgs at:14 put:wiconHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7803
    moreArgs at:15 put:windowType.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7804
    moreArgs at:16 put:windowClass.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7805
    moreArgs at:17 put:weventMask.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7806
    moreArgs at:18 put:(aView className asString).
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7807
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7808
    [
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7809
      windowId := self
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7810
		  primCreateWindowFor:aView
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7811
		  type:typeSymbol
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7812
		  borderWidth:bWidth
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7813
		  subViewOf:wsuperView
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7814
		  style:wStyle
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7815
		  inputOnly:winputOnly
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7816
		  label:wlabel
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7817
		  owner:wowner
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7818
		  icon:wicon
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7819
		  iconMask:wiconMask
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7820
		  moreArgs:moreArgs.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7821
      aView setId:windowId.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7822
    ] valueUninterruptably.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7823
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7824
    windowId notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7825
	self addKnownView:aView withId:windowId
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7826
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7827
    ^ 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
  7828
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
  7829
    "Modified: / 28-01-2012 / 10:20:30 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7830
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7831
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7832
destroyGC:aGCId
4478
fb57ec7d7cc4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
  7833
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7834
    if (__isExternalAddress(aGCId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7835
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7836
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7837
	if (gcData == NULL) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7838
	    console_fprintf(stderr, "WinWorkstation [warning]: trying to destroy GC twice\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7839
	    RETURN(self);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7840
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7841
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7842
#ifdef COUNT_RESOURCES
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7843
	 __cnt_gcData--;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7844
	RESPRINTF(("DestroyGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7845
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7846
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7847
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7848
	if (lastGcData == gcData) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  7849
	    _releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7850
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7851
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7852
	__ExternalAddressInstPtr(aGCId)->e_address = NULL;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  7853
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  7854
	freeGcData(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7855
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7856
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7857
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7858
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7859
destroyPixmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7860
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7861
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7862
    if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7863
	HANDLE bitmapHandle = _HANDLEVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7864
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7865
	if (bitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7866
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7867
	    __cnt_bitmap--;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7868
	    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
  7869
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7870
	    _DeleteObject(bitmapHandle, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7871
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7872
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7873
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7874
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7875
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7876
destroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7877
    self primDestroyView:aView withId:aWindowId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7878
    self removeKnownView:aView withId:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7879
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7880
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7881
gcFor:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7882
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7883
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7884
    HWND hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7885
    struct gcData *gcData;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7886
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7887
    if (__isExternalAddress(aDrawableId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7888
	hWnd = _HWNDVal(aDrawableId);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7889
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7890
	if (! hWnd) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7891
	    RETURN (nil);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7892
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7893
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7894
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7895
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7896
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7897
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7898
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7899
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7900
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7901
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7902
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7903
	gcData->hWnd = hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7904
	gcData->_hDC = 0;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7905
	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
  7906
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7907
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7908
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7909
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7910
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7911
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7912
gcForBitmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7913
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7914
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7915
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7916
    if (__isExternalAddress(aDrawableId)) {  /* HBITMAP */
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7917
	struct gcData *gcData;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7918
	BITMAP bitmap;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7919
	HBITMAP hBitmap = _HBITMAPVAL(aDrawableId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7920
	HDC hDC;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7921
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7922
	if (! hBitmap) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7923
	    RETURN (nil);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7924
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7925
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7926
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7927
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7928
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7929
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7930
	if (GetObject(hBitmap, sizeof(bitmap), &bitmap)) {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7931
	    DDPRINTF(("bitmap info:%d\n", bitmap.bmBitsPixel));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7932
	} else {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7933
	    DPRINTF(("noinfo returned for bitmap\n"));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7934
	    /* mhmh - can this happen ? */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7935
	    bitmap.bmBitsPixel = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7936
	}
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7937
	gcData->hBitmap = hBitmap;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7938
	gcData->bitmapColorBitCount = bitmap.bmBitsPixel;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7939
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7940
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7941
	__cnt_gcData++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7942
	RESPRINTF(("CreateGcData %d\n", __cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7943
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7944
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7945
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7946
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7947
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7948
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7949
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7950
gcForHDC: aDeviceContextHandle
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7951
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7952
%{  /* NOCONTEXT */
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7953
    HDC hDC;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7954
    struct gcData *gcData;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7955
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7956
    if (__isExternalAddressLike(aDeviceContextHandle)) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7957
	hDC = _HDCVal(aDeviceContextHandle);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7958
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7959
	if (! hDC) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7960
	    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7961
	}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7962
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7963
	gcData = newGcData();
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7964
	if (! gcData) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7965
	    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7966
	}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7967
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7968
#ifdef COUNT_RESOURCES
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7969
	__cnt_gcData++;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7970
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7971
#endif
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7972
	gcData->_hDC = hDC;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7973
	gcData->doNotCacheOrRelease = 1;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7974
	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
  7975
	RETURN ( __MKOBJ(gcData) );
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7976
    }
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7977
    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7978
%}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7979
!
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7980
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7981
primCreateBitmapFromArray:anArray width:w height:h
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7982
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7983
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7984
    HBITMAP newBitmapHandle;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7985
    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
  7986
    int row, col;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7987
    unsigned char *cp, *bPits;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7988
    unsigned char *b_bits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7989
    int index;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7990
    OBJ num;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7991
    unsigned char *allocatedBits = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7992
    unsigned char fastBits[10000];
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7993
5546
8387e6a32b6d Use __isArrayLike() and __isByteArrayLike()
Stefan Vogel <sv@exept.de>
parents: 5545
diff changeset
  7994
    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
  7995
	b_width = __intVal(w);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7996
	b_height = __intVal(h);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7997
	bytesPerRowST = (b_width + 7) / 8;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7998
	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
  7999
	padding = bytesPerRowWN - bytesPerRowST;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8000
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8001
	if ((padding == 0) && (__isByteArrayLike(anArray))) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8002
	    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
  8003
	    cp = 0;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8004
	} else {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8005
	    int nBytes = b_height * bytesPerRowWN;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8006
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8007
	    if (nBytes < sizeof(fastBits)) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8008
		cp = b_bits = fastBits;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8009
	    } else {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8010
		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
  8011
		if (! cp) goto fail;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8012
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8013
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8014
	if (cp) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8015
	    if (__qIsArrayLike(anArray)) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8016
		OBJ *op;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8017
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8018
		index = 1;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8019
		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
  8020
		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
  8021
		    for (col = bytesPerRowST; col; col--) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8022
			num = *op++;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8023
			if (! __isSmallInteger(num))
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8024
			    goto fail;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8025
			*cp++ = __intVal(num);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8026
		    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8027
		    cp += padding;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8028
		}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8029
	    } else if (__qIsByteArrayLike(anArray)) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8030
		unsigned char *pBits;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8031
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8032
		pBits = __ByteArrayInstPtr(anArray)->ba_element;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8033
		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
  8034
		    for (col = bytesPerRowST; col; col--) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8035
			*cp++ = ( *pBits++ /*^ 0xFF*/ );
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8036
		    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8037
		    cp += padding;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8038
		}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8039
	    } else {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8040
		goto fail;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8041
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8042
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8043
	CPRINTF(("create bitmap ...\n"));
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8044
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8045
	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
  8046
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8047
	if (newBitmapHandle ) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8048
#ifdef COUNT_BMP_RESOURCES
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8049
	    __cnt_bitmap++;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8050
	    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
  8051
#endif
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8052
	    DDPRINTF(("returning bitmap %x ...\n", newBitmapHandle));
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8053
	    if (allocatedBits) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8054
		free(allocatedBits);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8055
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8056
	    RETURN ( __MKEXTERNALADDRESS(newBitmapHandle));
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8057
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8058
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8059
fail: ;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8060
    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
  8061
    if (allocatedBits) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8062
	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
  8063
	free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8064
    }
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8065
    CPRINTF(("returning nil ...\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8066
    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8067
%}
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
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8070
primCreateWindowFor:aView type:typeSymbol
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8071
	  borderWidth:bWidth subViewOf:wsuperView
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8072
	  style:wStyle inputOnly:winputOnly
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8073
	  label:wlabel owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8074
	  icon:wicon iconMask:wiconMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8075
	  moreArgs:moreArgs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8076
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8077
%{  /* STACK: 16000 */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8078
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8079
    WNDCLASS wc;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8080
    long bg, bd, bw;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  8081
    int winStyleBits, winEXStyleBits;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8082
    int w, h, x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8083
    int min_width, min_height;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8084
    int max_width, max_height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8085
    OBJ eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8086
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8087
    HANDLE parentHandle;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8088
    HWND newWindowHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8089
    OBJ xpos, ypos, wwidth, wheight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8090
    OBJ minWidth, minHeight, maxWidth, maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8091
    OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8092
    OBJ wiconWidth, wiconHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8093
    OBJ windowType, windowClass, windowId;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8094
    OBJ stClassName;
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8095
    int isTopWindow = 0, isNativeWindow = 0, isMDIChild = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8096
    localWindowInfo *lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8097
    static createWindowInfo cwi;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8098
    static nextSequenceNr = 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8099
    unsigned char* cp;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8100
    HBITMAP        xBitMap, maskBitmap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8101
    HICON          xIcon = (HICON)0;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8102
    ICONINFO       iconInfo;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8103
    char *className;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8104
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8105
#   define MAX_LABEL_SIZE       256
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8106
#   define MAX_CLASSNAME_SIZE   256
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8107
    static wchar_t classNameBufferw[MAX_CLASSNAME_SIZE];
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8108
    static wchar_t windowNameBufferw[MAX_LABEL_SIZE];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8109
    unsigned char fastBits[10000];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8110
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8111
    xpos = __ArrayInstPtr(moreArgs)->a_element[0];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8112
    ypos = __ArrayInstPtr(moreArgs)->a_element[1];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8113
    wwidth = __ArrayInstPtr(moreArgs)->a_element[2];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8114
    wheight = __ArrayInstPtr(moreArgs)->a_element[3];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8115
    minWidth = __ArrayInstPtr(moreArgs)->a_element[4];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8116
    minHeight = __ArrayInstPtr(moreArgs)->a_element[5];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8117
    maxWidth = __ArrayInstPtr(moreArgs)->a_element[6];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8118
    maxHeight = __ArrayInstPtr(moreArgs)->a_element[7];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8119
    wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8120
    wcursorId = __ArrayInstPtr(moreArgs)->a_element[9];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8121
    wiconId = __ArrayInstPtr(moreArgs)->a_element[10];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8122
    wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8123
    wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8124
    wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8125
    windowType = __ArrayInstPtr(moreArgs)->a_element[14];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8126
    windowClass = __ArrayInstPtr(moreArgs)->a_element[15];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8127
    eventMask = __ArrayInstPtr(moreArgs)->a_element[16];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8128
    stClassName = __ArrayInstPtr(moreArgs)->a_element[17];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8129
    bg = WhitePixel;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8130
    bd = BlackPixel;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8131
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8132
    /* get bitmap for icon */
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8133
    if ( __isExternalAddress(wiconId) ) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8134
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8135
	if ( xBitMap != 0 ) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8136
	    BITMAP bm;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8137
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8138
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8139
		int d = bm.bmPlanes * bm.bmBitsPixel;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8140
		BYTE *ep;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8141
		int height, width;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8142
		int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8143
		unsigned char *allocatedBits = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8144
		int privateMask = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8145
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8146
		if ( __isExternalAddress(wiconMaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8147
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8148
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8149
		    if (wiconMaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8150
			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
  8151
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8152
		    maskBitmap = 0;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8153
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8154
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8155
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8156
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8157
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8158
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8159
		    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
  8160
		    height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8161
		    width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8162
		    nBytes = ( width + 15 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8163
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8164
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8165
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8166
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8167
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8168
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8169
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8170
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8171
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8172
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8173
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8174
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8175
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8176
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8177
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8178
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8179
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8180
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8181
		if ( maskBitmap != NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8182
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8183
		    iconInfo.fIcon = TRUE;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8184
		    iconInfo.hbmMask  = maskBitmap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8185
		    iconInfo.hbmColor = xBitMap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8186
		    xIcon = CreateIconIndirect( &iconInfo );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8187
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  8188
			_DeleteObject( maskBitmap, __LINE__ );
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8189
		    }
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8190
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8191
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8192
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8193
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8194
		if (allocatedBits) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8195
		    free(allocatedBits);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8196
		}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8197
	    }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8198
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8199
	    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
  8200
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8201
    } else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8202
	if (wiconId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8203
	    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
  8204
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8205
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8206
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8207
    if (__bothSmallInteger(wwidth, wheight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8208
	w = __intVal(wwidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8209
	h = __intVal(wheight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8210
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8211
	w = h = 100;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8212
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8213
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8214
    if (__bothSmallInteger(xpos, ypos)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8215
	x = __intVal(xpos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8216
	y = __intVal(ypos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8217
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8218
	x = y = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8219
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8220
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8221
    if (__bothSmallInteger(minWidth, minHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8222
	min_width = __intVal(minWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8223
	min_height = __intVal(minHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8224
    } else {
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8225
	DPRINTF(("WinWorkstat [warning]: minWidth/minHeight not integer\n"))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8226
	min_width = min_height = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8227
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8228
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8229
    if (__bothSmallInteger(maxWidth, maxHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8230
	max_width = __intVal(maxWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8231
	max_height = __intVal(maxHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8232
    } else {
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8233
	DPRINTF(("WinWorkstat [warning]: maxWidth/maxHeight not integer\n"))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8234
	max_width = max_height = 10000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8235
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8236
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  8237
    winStyleBits = winEXStyleBits = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8238
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8239
    if (__isSmallInteger(bWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8240
	bw = __intVal(bWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8241
	if (bw) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8242
	    winStyleBits |= WS_BORDER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8243
	    bw = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8244
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8245
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8246
	bw = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8247
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8248
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8249
    className = app_name;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8250
    if (__isStringLike(windowClass)) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8251
	className = __stringVal(windowClass);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8252
	NDPRINTF(("className: %s\n", className));
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8253
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8254
	if (__isInteger(wStyle)) {
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8255
	    isNativeWindow = 1;
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8256
	    winStyleBits |= __longIntVal(wStyle);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8257
	    NDPRINTF(("winStyleBits: %x\n", winStyleBits));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8258
	} else {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8259
	    if (windowType != nil) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8260
		if (windowType == @symbol(RadioButton)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8261
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8262
		    winStyleBits |= BS_RADIOBUTTON;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8263
		    NDPRINTF(("class: %s - winStyleBits BS_RADIOBUTTON: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8264
		} else if (windowType == @symbol(CheckBox)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8265
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8266
		    winStyleBits |= BS_CHECKBOX;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8267
		    NDPRINTF(("class: %s - winStyleBits BS_CHECKBOX: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8268
		} else if (windowType == @symbol(HorizontalScrollBar)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8269
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8270
		    winStyleBits |= SBS_HORZ;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8271
		    NDPRINTF(("class: %s - winStyleBits SBS_HORZ: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8272
		} else if (windowType == @symbol(VerticalScrollBar)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8273
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8274
		    winStyleBits |= SBS_VERT;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8275
		    NDPRINTF(("class: %s - winStyleBits SBS_VERT: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8276
		} else if (windowType == @symbol(Button)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8277
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8278
		    NDPRINTF(("class: %s\n", className));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8279
		} else if (windowType == @symbol(OwnerDrawButton)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8280
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8281
		    winStyleBits |= BS_OWNERDRAW;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8282
		    NDPRINTF(("class: %s - winStyleBits BS_OWNERDRAW: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8283
		}
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8284
	    }
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8285
	}
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8286
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8287
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8288
    if (__isExternalAddress(wsuperViewId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8289
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8290
	 * a child window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8291
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8292
	parentHandle = _HANDLEVal(wsuperViewId);
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8293
	if (wStyle == @symbol(mdiChild)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8294
	    isMDIChild = 1;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8295
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8296
    } else {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8297
	parentHandle = NULL;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8298
	isTopWindow = 1;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8299
    }
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8300
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8301
    if (!isTopWindow && !isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8302
	/*
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8303
	 * a child window
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8304
	 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8305
	winStyleBits |= WS_CHILD;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8306
	if (winputOnly != true) {
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8307
	    winStyleBits |= (WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8308
	    /*winStyleBits |= WS_CLIPCHILDREN;*/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8309
	    DPRINTF(("parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8310
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8311
	    winEXStyleBits |= WS_EX_TRANSPARENT;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8312
	    DPRINTF(("inputview parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8313
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8314
#if 0
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8315
	winEXStyleBits |= WS_EX_NOPARENTNOTIFY;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8316
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8317
    } else {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8318
	/*
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8319
	 * a top window (regular / popUp / dialog) or MDIChild
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8320
	 */
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8321
	if (isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8322
	    winEXStyleBits |= WS_EX_MDICHILD;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8323
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8324
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8325
	if (! isMDIChild)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8326
	{
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8327
#ifdef TOPWINDOWCLASS
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8328
	    this could fail, since a pointer to local buf is passed
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8329
	    to the window-creation code (in the other thread ...)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8330
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8331
	    static winCount = 1;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8332
	    char buf[300];
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8333
	    char *stName;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8334
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8335
# ifdef __BORLANDC__
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8336
	    struct timeb timebuffer;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8337
	    ftime(&timebuffer);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8338
# else
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8339
	    struct _timeb timebuffer;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8340
	    _ftime(&timebuffer);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8341
# endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8342
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8343
	    if (__isStringLike(stClassName)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8344
		stName = __stringVal(stClassName);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8345
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8346
		stName = app_name;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8347
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8348
	    sprintf(buf, "S%d.%d%s", HIWORD(timebuffer.time), ++winCount, stName);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8349
	    DPRINTF(("topview - registerClass:%s\n",buf));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8350
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8351
	    wc.style = /* CS_HREDRAW | CS_VREDRAW | CS_OWNDC  |*/ CS_DBLCLKS;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8352
	    wc.lpfnWndProc = (WNDPROC) MainWndProc;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8353
	    wc.cbClsExtra = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8354
	    wc.cbWndExtra = N_WINDOW_PRIVATE;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8355
	    wc.hInstance = (HANDLE) __getHInstance();
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8356
	    if (xIcon) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8357
		wc.hIcon   = xIcon;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8358
		/* 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
  8359
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8360
		wc.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8361
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8362
	    wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8363
	    wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8364
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8365
	    wc.lpszMenuName =  NULL;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8366
	    wc.lpszClassName = buf;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8367
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8368
	    if (!RegisterClass(&wc)) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8369
		PRINTF(("RegisterClass failed\n"));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8370
		RETURN( nil );
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8371
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8372
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8373
	    className = buf;
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8374
#endif /* TOPWINDOWCLASS */
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8375
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8376
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8377
	if (wStyle == @symbol(popUp)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8378
	    winStyleBits |= WS_POPUP;
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8379
	    // winStyleBits |= WS_DISABLED;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8380
	    winEXStyleBits |= WS_EX_TOOLWINDOW;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8381
	    CPRINTF(("Create popUpWindow\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8382
#if 0
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8383
	    parentHandle = GetActiveWindow();
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8384
#endif
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8385
	} else if (wStyle == @symbol(popUpWithFrame)) {
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8386
	    winStyleBits |= WS_POPUP | WS_THICKFRAME /* | WS_CAPTION | DS_MODALFRAME | WS_SIZEBOX */ ;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8387
	    // winStyleBits |= WS_DISABLED;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8388
	    // winEXStyleBits |= WS_EX_TOOLWINDOW;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8389
	    CPRINTF(("Create popUpWindow\n"));
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8390
#if 0
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8391
	    parentHandle = GetActiveWindow();
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8392
#endif
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8393
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8394
	} else if ((wStyle == @symbol(dialog)) || (wStyle == @symbol(toolDialog))) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8395
	    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
  8396
	    winStyleBits |= WS_POPUP;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8397
	    winStyleBits |= DS_NOIDLEMSG;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  8398
	    //winEXStyleBits |= WS_EX_TOOLWINDOW;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8399
	    if ((min_width || min_height)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8400
	     && (min_width == max_width)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8401
	     && (min_height == max_height)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8402
		winStyleBits &= ~WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8403
	    }
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8404
	    if (wStyle == @symbol(toolDialog)) {
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8405
		winEXStyleBits |= WS_EX_TOOLWINDOW;
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8406
	    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8407
	} else if (wStyle == @symbol(undecorated)) {
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8408
	    winStyleBits |= WS_OVERLAPPED;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8409
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8410
	} else if (wStyle == @symbol(undecoratedResizable)) {
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8411
	    winStyleBits |= WS_OVERLAPPED | WS_THICKFRAME;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8412
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8413
	} else if (isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8414
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | DS_MODALFRAME | WS_SYSMENU | WS_SIZEBOX;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8415
	    if ((min_width || min_height)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8416
	     && (min_width == max_width)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8417
	     && (min_height == max_height)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8418
		winStyleBits &= ~WS_THICKFRAME;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8419
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8420
	} else {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8421
	    //winStyleBits |= WS_OVERLAPPEDWINDOW;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8422
	    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
  8423
	    //winEXStyleBits |= WS_EX_CLIENTEDGE;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  8424
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  8425
	    //winEXStyleBits |= WS_EX_ACCEPTFILES;
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8426
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8427
	    if (wStyle == @symbol(toolWindow)) {
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8428
		winEXStyleBits |= WS_EX_TOOLWINDOW;
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8429
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8430
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8431
	winStyleBits |= WS_CLIPCHILDREN;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8432
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8433
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8434
    rec.left = x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8435
    rec.top = y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8436
    rec.right = x + w;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8437
    rec.bottom = y+ h;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8438
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8439
    /* use static memory for the createwindowInfo;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8440
     * 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
  8441
     * 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
  8442
     * when in a sizeMove-loop.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8443
     * (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
  8444
     *  early via the pending- mechanism)
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8445
     * 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
  8446
     * 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
  8447
     * 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
  8448
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8449
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8450
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8451
     * check if previous request has been properly processed ...
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8452
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8453
    if (cwi.sequenceNr && (cwi.sequenceNr != INVALIDATED_CWI)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8454
	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
  8455
	/* this prevents the event processor from interpreting this message */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8456
	cwi.sequenceNr = nextSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8457
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8458
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8459
    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
  8460
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8461
#ifdef ADJUSTWINDOW
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8462
    AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8463
    w = rec.right - rec.left;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8464
    h = rec.bottom - rec.top;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8465
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8466
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8467
    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
  8468
		((wStyle == @symbol(popUp)) ? " popUp" : ""),
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8469
		x, y, w, h,
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8470
		bw, parentHandle, className,
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8471
		winStyleBits, winEXStyleBits));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8472
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8473
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8474
    lI = (localWindowInfo *) malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8475
    if (! lI) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8476
	console_fprintf(stderr, "WinWorkstation [error]: malloc failed in CreateWindow\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8477
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8478
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8479
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8480
    memset(lI, 0, sizeof(localWindowInfo));
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8481
    lI->mouseX = lI->mouseY = -9999;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8482
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8483
    if (isTopWindow) {
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  8484
/****** MULTI SCREEN *********
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8485
	if (rec.left < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8486
	    rec.left = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8487
	    rec.right = w;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8488
	}
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  8489
****** MULTI SCREEN *********/
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8490
	if (rec.top < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8491
	    rec.top = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8492
	    rec.bottom = h;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8493
	}
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  8494
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8495
	lI->flag |= LI_TOPWIN;
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  8496
    } else {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8497
	if (bw) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8498
	    // adjust for border
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8499
	    rec.left++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8500
	    rec.top++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8501
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8502
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8503
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8504
    if (winputOnly == true) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8505
	lI->flag |= LI_INPUTWIN;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8506
    }
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8507
    if (isNativeWindow) {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  8508
	NDPRINTF(("set native flag\n"));
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8509
	lI->flag |= LI_NATIVEWIN;
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8510
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8511
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8512
    if (wStyle == @symbol(popUp)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8513
	cwi.className = wapp_namePopup;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8514
    } else {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8515
	if (wStyle == @symbol(dialog)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8516
	    cwi.className = wapp_nameDialog;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8517
	} else {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8518
	    ch2wch(className, classNameBufferw, MAX_CLASSNAME_SIZE);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8519
	    cwi.className = classNameBufferw;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8520
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8521
    }
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8522
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8523
    cwi.winStyleBits = winStyleBits;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8524
    cwi.parentHandle = parentHandle;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8525
    cwi.x = rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8526
    cwi.y = rec.top;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8527
    cwi.dx = rec.right - rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8528
    cwi.dy = rec.bottom - rec.top;
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8529
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8530
    if (isTopWindow | isMDIChild) {
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8531
	rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8532
	rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8533
	rec.right = min_width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8534
	rec.bottom = min_height;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8535
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8536
	AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8537
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8538
	lI->minWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8539
	lI->minHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8540
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8541
	rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8542
	rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8543
	rec.right = max_width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8544
	rec.bottom = max_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8545
#ifdef ADJUSTWINDOW
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8546
	AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8547
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8548
	lI->maxWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8549
	lI->maxHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8550
    } else {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8551
	lI->minWidth = lI->minHeight = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8552
	lI->maxWidth = lI->maxHeight = 9999;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8553
    }
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  8554
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  8555
    lI->viewBgBrush = __whiteBrush;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  8556
    lI->viewBgColor = WhitePixel;
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  8557
    lI->bdColor = BlackPixel;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  8558
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8559
    if (__isSmallInteger(eventMask))
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8560
	lI->eventMask = __intVal(eventMask);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8561
    else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8562
	lI->eventMask = 0xffffffff;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8563
    DPRINTF(("eventMask is %x\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8564
#ifdef DEBUGMASK1
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8565
    printMask(lI->eventMask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8566
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8567
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8568
    lI->bw = bw;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8569
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8570
    cwi.newWinHandle = newWindowHandle = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8571
    cwi.windowName = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8572
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8573
    if (isTopWindow | isMDIChild) {
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8574
	if (__isStringLike(wlabel)) {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8575
	    ch2wch((char *)__stringVal(wlabel), windowNameBufferw, MAX_LABEL_SIZE);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8576
	    cwi.windowName = windowNameBufferw;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8577
	} else
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8578
	    if (__isUnicode16String(wlabel)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8579
		int l = __unicode16StringSize(wlabel);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8580
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8581
		if (l >= MAX_LABEL_SIZE) l = MAX_LABEL_SIZE-1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8582
		memmove(windowNameBufferw, __unicode16StringVal(wlabel), l*sizeof(wchar_t));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8583
		windowNameBufferw[ l ] = 0;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8584
		cwi.windowName = windowNameBufferw;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8585
	    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8586
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8587
2665
4b88034ccb36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2664
diff changeset
  8588
    cwi.infoWasRead = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8589
    cwi.localWindowInfo = lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8590
    cwi.sequenceNr = nextSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8591
    nextSequenceNr = (nextSequenceNr + 1) & 0x7FFF;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8592
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8593
#ifndef NEW_CREATE_EVENT
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8594
    cwi.hCreateEvent = hCreateEvent;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8595
    ResetEvent(cwi.hCreateEvent);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8596
#else
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8597
    /* creating a new event does not work - why ? */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8598
    cwi.hCreateEvent = CreateEvent(
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8599
	NULL,        /* no security attributes */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8600
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8601
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8602
	NULL);       /* name of mutex */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8603
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8604
    if (cwi.hCreateEvent == NULL) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8605
	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
  8606
	cwi.sequenceNr = INVALIDATED_CWI;
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8607
	free(lI);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8608
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8609
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8610
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8611
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8612
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8613
     * kludge to allow for createWindow while in sizeMove processing loop
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8614
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8615
    if (pendingCREATEWINDOWInfo) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8616
	console_fprintf(stderr, "WinWorkstation [error]: oops - pending create\n");
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8617
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8618
    pendingCREATEWINDOWInfo = &cwi;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8619
    pendingSequenceNr = cwi.sequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8620
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8621
    if (PostThreadMessage(_dispatchThreadId, WM_THREAD_CREATEWINDOW, cwi.sequenceNr, (INT)(&cwi)) == FALSE) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8622
	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
  8623
					_dispatchThreadId, GetLastError() );
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8624
	free(lI);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8625
	RETURN (nil);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8626
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8627
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8628
    if (cwi.newWinHandle != NULL) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8629
	cwi.sequenceNr = INVALIDATED_CWI;
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  8630
	cwi.hCreateEvent = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8631
	/* wow - that was quick ... */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8632
    } else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8633
	DWORD dwWaitResult;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8634
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8635
	/* wait for the window to be created ... */
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  8636
	dwWaitResult = WaitForSingleObject(hCreateEvent, 5000L);
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
	/* no longer want to get informed ... */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8639
	cwi.hCreateEvent = NULL;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8640
	cwi.sequenceNr = INVALIDATED_CWI;
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
	switch (dwWaitResult) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8643
	    // The thread got mutex ownership.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8644
	    case WAIT_OBJECT_0:
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8645
		break;
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
	    // Cannot get mutex ownership due to time-out.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8648
	    case WAIT_TIMEOUT:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8649
		DEBUGFPRINTF((stderr, "WinWorkstation [error]: oops - timeout in CreateWindow\n"));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8650
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8651
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8652
	    // Got ownership of the abandoned mutex object.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8653
	    default:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8654
		DEBUGFPRINTF((stderr, "WinWorkstation [warning]: CreateEvent abandoned\n"));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8655
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8656
	}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8657
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8658
#ifdef NEW_CREATE_EVENT
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8659
	CloseHandle(cwi.hCreateEvent);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8660
#endif
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8661
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8662
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8663
    pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8664
    newWindowHandle = cwi.newWinHandle;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8665
    DPRINTF(("handle = %x\n", newWindowHandle));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8666
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8667
    if (! newWindowHandle) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8668
	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
  8669
			cwi.errCode, cwi.errCode, __LINE__ );
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  8670
	if (cwi.infoWasRead) {
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  8671
	    free(lI);
4284
5efcb512f038 *** empty log message ***
ca
parents: 4281
diff changeset
  8672
	} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8673
	    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
  8674
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8675
	RETURN ( nil );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8676
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8677
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8678
#ifdef CACHE_LAST_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8679
    if (lastGcData && (lastGcHWIN == newWindowHandle)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8680
	_releaseDC(lastGcData);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8681
    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8682
#endif
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8683
#ifdef CACHE_LAST_WM_PAINT_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8684
    if (last_wm_paint_dc && (last_wm_paint_win == newWindowHandle)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8685
	ReleaseDC(newWindowHandle, last_wm_paint_dc);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8686
	last_wm_paint_win = last_wm_paint_dc = 0;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8687
    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8688
#endif
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8689
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8690
    windowId = __MKOBJ(newWindowHandle);
4368
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8691
#if 1
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8692
    if (isTopWindow | isMDIChild) {
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8693
	/*
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8694
	 * mhmh - what is that raise for ?
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8695
	 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8696
	SetWindowPos(newWindowHandle, HWND_TOP, 0, 0, 0, 0,
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8697
		     SWP_NOSENDCHANGING |
4368
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8698
		     /* SWP_NOACTIVATE | */ SWP_NOMOVE | SWP_NOSIZE);
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8699
    } else {
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8700
	SetWindowPos(newWindowHandle, HWND_TOP, 0, 0, 0, 0,
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8701
		     SWP_NOSENDCHANGING |
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8702
		     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8703
    }
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8704
#endif
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8705
    if (isTopWindow | isMDIChild) {
2697
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  8706
	BringWindowToTop(newWindowHandle);
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  8707
    }
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8708
    DragAcceptFiles(newWindowHandle, 1);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8709
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8710
    if (isNativeWindow) {
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8711
	if (winStyleBits & (SBS_HORZ | SBS_VERT)) {
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  8712
	    SetScrollRange(newWindowHandle, SB_CTL, 0, 100, 0);
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  8713
	    SetScrollPos(newWindowHandle, SB_CTL, 0, 0);
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8714
	}
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8715
    }
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8716
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8717
#ifndef TOPWINDOWCLASS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8718
    if (xIcon) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8719
	SendMessage(newWindowHandle, WM_SETICON, ICON_SMALL, (LPARAM)xIcon);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8720
	SendMessage(newWindowHandle, WM_SETICON, ICON_BIG, (LPARAM)xIcon);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8721
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8722
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8723
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8724
    DPRINTF(("done - create\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8725
    RETURN (windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8726
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8727
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8728
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8729
primDestroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8730
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8731
%{  /* NOCONTEXT */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8732
    HICON oldIcon;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8733
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8734
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8735
	HWND win = _HWNDVal(aWindowId);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8736
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8737
	if (win && IsWindow(win)) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8738
#ifndef TOPWINDOWCLASS
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8739
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8740
	    SetClassLong(win, GCL_HICON, (DWORD)0);
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8741
	    /* 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
  8742
	    if ( oldIcon ) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8743
		if ( DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8744
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8745
		} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8746
		    console_fprintf(stderr, "failed to destroy icon\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8747
		}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8748
	    }
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8749
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8750
	   /*console_printf("post WM_THREAD_DESTROYWINDOW\n");*/
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8751
	    PostMessage(win, WM_THREAD_DESTROYWINDOW, 0, 0);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8752
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8753
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8754
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8755
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8756
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8757
rootWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8758
    "return the id of the root window.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8759
     This is the window you see as background,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8760
     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
  8761
     since some window managers install a virtual root window on top
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8762
     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
  8763
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8764
    ^ rootWin
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8765
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8766
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8767
!WinWorkstation methodsFor:'clipboard'!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8768
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8769
getClipboardObjectFor:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8770
    "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
  8771
     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
  8772
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8773
    |currentSequenceNumber|
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8774
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8775
    currentSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8776
    lastClipboardSequenceNumber ~= currentSequenceNumber ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8777
	"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
  8778
	 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
  8779
	 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
  8780
	 behavior."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8781
	copyBuffer := self getClipboardData.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8782
	lastClipboardSequenceNumber := currentSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8783
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8784
    ^ copyBuffer
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8785
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8786
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8787
getClipboardText:selectionBufferSymbol for:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8788
     "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
  8789
      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
  8790
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8791
    |currentSequenceNumber|
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8792
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8793
    currentSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8794
    lastClipboardSequenceNumber ~= currentSequenceNumber ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8795
	"copyBuffer is invalid, fill it from the windows clipboard.
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8796
	 Even if we could not decode the windows clipboard,
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8797
	 we intentionally set the copyBuffer to nil to get a consistent
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8798
	 behavior."
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8799
	copyBuffer := self getClipboardData.
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8800
	lastClipboardSequenceNumber := currentSequenceNumber.
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8801
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8802
    ^ self copyBufferAsString
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8803
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8804
    "
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8805
     Screen current getClipboardText:#clipboard for:nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8806
    "
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8807
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8808
    "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
  8809
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8810
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8811
setClipboardObject:something owner:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8812
    "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
  8813
     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
  8814
     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
  8815
     to other applications."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8816
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8817
    something isString ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8818
	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
  8819
	^ self
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8820
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8821
    something isStringCollection ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8822
	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
  8823
	^ self
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8824
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8825
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8826
    "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
  8827
     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
  8828
    lastClipboardSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8829
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8830
    "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
  8831
    "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
  8832
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8833
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8834
setClipboardText:something owner:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8835
    "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
  8836
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8837
    |result|
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8838
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8839
    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
  8840
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8841
    "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
  8842
    lastClipboardSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8843
    ^ result.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8844
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8845
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8846
    "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
  8847
    "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
  8848
! !
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8849
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8850
!WinWorkstation methodsFor:'clipboard-private'!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8851
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8852
getClipboardData
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8853
    "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
  8854
     Answer a string on success or nil otherwise.
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8855
     Caveat: for now, only Text and UnicodeText are supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8856
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8857
    |data|
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8858
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8859
    (data := self getUnicodeClipboardData) notNil ifTrue:[^ data].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8860
    (data := self getTextClipboardData) notNil ifTrue:[^ data].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8861
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8862
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8863
    "Modified: / 09-10-2007 / 12:47:02 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8864
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8865
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8866
getClipboardDataBytes:format
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8867
    "get the contents of the windows clipboard as raw bytes.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8868
     Answer an image on success or nil otherwise."
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8869
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8870
    |bytes|
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8871
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8872
%{
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8873
    HANDLE hClip;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8874
    HANDLE hData;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8875
    unsigned char *src, *p;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8876
    WIDECHAR *w_src, *w_p;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8877
    int fmt;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8878
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8879
    if (format == @symbol(CF_TIFF)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8880
	fmt = CF_TIFF;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8881
    } else if (format == @symbol(CF_BITMAP)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8882
	fmt = CF_BITMAP;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8883
    } else if (format == @symbol(CF_DIB)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8884
	fmt = CF_DIB;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8885
    } else
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8886
	goto badFormat;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8887
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8888
    if (IsClipboardFormatAvailable(fmt)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8889
	int len;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8890
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8891
	hClip = OpenClipboard(NULL);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8892
	if (hClip) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8893
	    hData = GetClipboardData(fmt);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8894
	    if (hData) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8895
		len = GlobalSize(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8896
		src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8897
		if (src) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8898
		    bytes = __MKBYTEARRAY(src, len);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8899
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8900
		GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8901
		CloseClipboard();
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8902
		DDPRINTF((stderr, "WinWorkstation [info]: clipBoard data size is <%d>\n", len));
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8903
		RETURN(bytes);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8904
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8905
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8906
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8907
badFormat: ;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8908
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8909
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8910
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8911
    "
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8912
     Screen current getClipboardDataBytes:#CF_TIFF
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8913
     Screen current getClipboardDataBytes:#CF_BITMAP
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8914
     Screen current getClipboardDataBytes:#CF_DIB
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8915
    "
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8916
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8917
    "Created: / 09-10-2007 / 13:11:12 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8918
    "Modified: / 09-10-2007 / 14:18:26 / cg"
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8919
!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8920
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8921
getClipboardOwner
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8922
    "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
  8923
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8924
%{
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8925
    HANDLE hWnd;
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8926
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8927
    hWnd = GetClipboardOwner();
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8928
    RETURN(__MKEXTERNALADDRESS(hWnd));
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8929
%}
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8930
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8931
   "
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8932
	Screen current getClipboardOwner
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8933
   "
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8934
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8935
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8936
getClipboardSequenceNumber
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8937
    "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
  8938
     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
  8939
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8940
%{
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8941
    DWORD sequenceNumber;
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8942
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8943
    sequenceNumber = GetClipboardSequenceNumber();
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8944
    RETURN(__MKUINT(sequenceNumber));
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8945
%}
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8946
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8947
   "
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8948
	Screen current getClipboardSequenceNumber
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8949
   "
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8950
!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8951
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8952
getImapeClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8953
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8954
     Answer an image on success or nil otherwise."
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8955
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8956
    |data|
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8957
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8958
    (data := self getClipboardDataBytes:#CF_TIFF) notNil ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8959
	"/ tiff image in data...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8960
	^ "TIFFReader fromBytes:data" nil
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8961
    ].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8962
    (data := self getClipboardDataBytes:#CF_DIB) notNil ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8963
	"/ device independent bitmap image in data...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8964
	^ "TIFFReader fromBytes:data" nil
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8965
    ].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8966
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8967
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8968
    "Created: / 09-10-2007 / 14:19:53 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8969
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8970
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8971
getTextClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8972
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8973
     Answer a string on success or nil otherwise.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8974
     Caveat: for now, only Text is supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8975
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8976
%{
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8977
    HANDLE hClip;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8978
    HANDLE hData;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8979
    OBJ s;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8980
    unsigned char *src, *p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8981
    WIDECHAR *w_src, *w_p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8982
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8983
    /* check for format CF_TEXT */
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8984
    if (IsClipboardFormatAvailable(CF_TEXT)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8985
	int nRemain, len, realLen;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8986
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8987
	hClip = OpenClipboard(NULL);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8988
	if (hClip) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8989
	    hData = GetClipboardData(CF_TEXT);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8990
	    src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8991
	    len = src ? strlen(src) : 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8992
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8993
	    /* 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
  8994
	    for (realLen=nRemain=len, p=src; nRemain; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8995
		unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8996
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8997
		ch = *p++; nRemain--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8998
		if (ch == 0x0D) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8999
		    if (nRemain && (*p == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9000
			p++; nRemain--;realLen--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9001
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9002
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9003
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9004
	    s = __MKEMPTYSTRING(realLen);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9005
	    if (s != nil) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9006
		for (p=__stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9007
		    unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9008
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9009
		    *p = ch = *src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9010
		    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9011
		    if (len && (ch == 0x0D) && (*src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9012
			*p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9013
			src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9014
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9015
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9016
		    p++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9017
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9018
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9019
	    GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9020
	    CloseClipboard();
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9021
	    DDPRINTF((stderr, "WinWorkstation [info]: clipBoard data is <%s>\n", (char *)hData));
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9022
	    RETURN(s);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9023
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9024
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9025
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9026
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9027
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9028
    "Created: / 09-10-2007 / 12:46:00 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9029
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9030
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9031
getUnicodeClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9032
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9033
     Answer a string on success or nil otherwise.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9034
     Caveat: for now, only Text is supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9035
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9036
%{
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9037
    HANDLE hClip;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9038
    HANDLE hData;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9039
    OBJ s;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9040
    unsigned char *src, *p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9041
    WIDECHAR *w_src, *w_p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9042
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9043
    /* Unicode */
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9044
    if (IsClipboardFormatAvailable(CF_UNICODETEXT)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9045
	int nRemain, len, realLen;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9046
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9047
	hClip = OpenClipboard(NULL);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9048
	if (hClip) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9049
	    int needUnicode = 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9050
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9051
	    hData = GetClipboardData(CF_UNICODETEXT);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9052
	    w_src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9053
	    len = w_src ? wcslen(w_src) : 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9054
	    /*
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9055
	     * 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
  9056
	     * and if result is really Unicode ...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9057
	     */
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9058
	    for (realLen=nRemain=len, w_p=w_src; nRemain; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9059
		WIDECHAR w_ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9060
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9061
		w_ch = *w_p++; nRemain--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9062
		if ((unsigned) w_ch > 0xFF) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9063
		    needUnicode = 1;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9064
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9065
		if (w_ch == 0x0D) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9066
		    if (nRemain && (*w_p == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9067
			w_p++; nRemain--;realLen--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9068
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9069
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9070
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9071
	    if (! needUnicode) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9072
		s = __MKEMPTYSTRING(realLen);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9073
		if (s != nil) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9074
		    for (p = __stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9075
			unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9076
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9077
			*p = ch = *w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9078
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9079
			if (len && (ch == 0x0D) && (*w_src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9080
			    *p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9081
			    w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9082
			    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9083
			}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9084
			p++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9085
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9086
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9087
	    } else {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9088
		s = __BYTEARRAY_NEW_INT(realLen * 2);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9089
		if (s != nil) {
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  9090
		    __qClass(s) = @global(Unicode16String);
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9091
		    for (w_p = (WIDECHAR *)__stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9092
			WIDECHAR w_ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9093
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9094
			*w_p = w_ch = *w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9095
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9096
			if (len && (w_ch == 0x0D) && (*w_src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9097
			    *w_p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9098
			    w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9099
			    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9100
			}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9101
			w_p++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9102
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9103
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9104
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9105
	    GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9106
	    CloseClipboard();
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9107
	    RETURN(s);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9108
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9109
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9110
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9111
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9112
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9113
    "Created: / 09-10-2007 / 12:45:26 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9114
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9115
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9116
setClipboardData:aString
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9117
    "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
  9118
     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
  9119
     Caveat: for now, only Text is supported."
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9120
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9121
%{
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9122
    HANDLE hClip;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9123
    HANDLE hData;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9124
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  9125
    if (__isStringLike(aString)) {
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9126
	char *s, *p, *src, *dst;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9127
	int n, len, realLen;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9128
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9129
	hClip = OpenClipboard(NULL);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9130
	if (hClip) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9131
	    s = __stringVal(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9132
	    /* must replace CR by CRLF */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9133
	    len = realLen = __stringSize(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9134
	    for (src=s, n=len; n; n--) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9135
		if ((src[0] == 0x0A) && ((src == s) || (src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9136
		    realLen++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9137
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9138
		src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9139
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9140
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9141
	    hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, realLen+1);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9142
	    if (hData) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9143
		char *t = GlobalLock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9144
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9145
		if (t) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9146
		    for (src=s, dst=t, n=len; n;) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9147
			unsigned char ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9148
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9149
			ch = src[0]; n--;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9150
			if ((ch == 0x0A) && ((src == s) || (src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9151
			    *dst++ = 0x0D;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9152
			    *dst++ = 0x0A;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9153
			} else {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9154
			    *dst++ = ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9155
			}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9156
			src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9157
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9158
		    *dst = 0;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9159
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9160
		    EmptyClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9161
		    if (SetClipboardData(CF_TEXT, hData) != 0) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9162
			/* Note: After setting clipboard data,
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9163
			 * the memory block previously allocated belongs to
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9164
			 * the clipboard - not to the app.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9165
			 */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9166
			CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9167
			RETURN (true);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9168
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9169
		    DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9170
		    GlobalUnlock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9171
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9172
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9173
	    CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9174
	}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9175
	RETURN(false);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9176
    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9177
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9178
    /* Unicode */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9179
    if (__isWords(aString)) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9180
	WIDECHAR *w_s, *w_p, *w_src, *w_dst;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9181
	int n, len, realLen;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9182
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9183
	hClip = OpenClipboard(NULL);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9184
	if (hClip) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9185
	    OBJ cls;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9186
	    int nInstBytes;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9187
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9188
	    cls = __qClass(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9189
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9190
	    w_s = (WIDECHAR *)(__stringVal(aString) + nInstBytes);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9191
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9192
	    /* must replace CR by CRLF */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9193
	    len = realLen = (__byteArraySize(aString) - nInstBytes) / 2;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9194
	    for (w_src=w_s, n=len; n; n--) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9195
		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
  9196
		    realLen++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9197
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9198
		w_src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9199
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9200
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9201
	    hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, (realLen+1)*sizeof(WIDECHAR));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9202
	    if (hData) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9203
		char *t = GlobalLock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9204
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9205
		if (t) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9206
		    for (w_src=w_s, w_dst=t, n=len; n;) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9207
			WIDECHAR w_ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9208
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9209
			w_ch = w_src[0]; n--;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9210
			if ((w_ch == 0x0A) && ((w_src == w_s) || (w_src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9211
			    *w_dst++ = 0x0D;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9212
			    *w_dst++ = 0x0A;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9213
			} else {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9214
			    *w_dst++ = w_ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9215
			}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9216
			w_src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9217
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9218
		    *w_dst = 0;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9219
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9220
		    EmptyClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9221
		    if (SetClipboardData(CF_UNICODETEXT, hData) != 0) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9222
			/* Note: After setting clipboard data,
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9223
			 * the memory block previously allocated belongs to
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9224
			 * the clipboard - not to the app.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9225
			 */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9226
			CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9227
			RETURN (true);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9228
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9229
		    DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9230
		    GlobalUnlock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9231
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9232
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9233
	    CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9234
	}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9235
	RETURN(false);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9236
    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9237
%}.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9238
    self primitiveFailed.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9239
! !
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9240
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9241
!WinWorkstation methodsFor:'color stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9242
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9243
colorRed:redVal green:greenVal blue:blueVal
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9244
    "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
  9245
     This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9246
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9247
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9248
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9249
    r := self percentToDeviceColorValue:redVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9250
    g := self percentToDeviceColorValue:greenVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9251
    b := self percentToDeviceColorValue:blueVal.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9252
    ^ self colorScaledRed:r scaledGreen:g scaledBlue:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9253
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9254
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9255
colorScaledRed:r scaledGreen:g scaledBlue:b
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9256
    "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
  9257
     (i.e. colorID)"
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9258
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9259
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9260
    int id, ir, ig, ib;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9261
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  9262
    if (__bothSmallInteger(r, g) && __isSmallInteger(b)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  9263
	id = RGB2st(__intVal(r),__intVal(g),__intVal(b));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9264
	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
  9265
	RETURN ( __MKSMALLINT(id) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9266
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9267
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9268
    self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9269
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9270
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9271
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9272
freeColor:colorIndex
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  9273
    "free a display color when its no longer needed.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  9274
     A dummy here, since RGB colors are never freed."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9275
4074
b40ae99d0f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  9276
    "/ 'free color' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9277
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9278
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9279
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9280
getRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9281
    "get rgb components (0..100) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9282
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9283
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9284
    |val|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9285
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9286
    self getScaledRGBFrom:index into:[:r :g :b |
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9287
	val := aBlock
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9288
		value:(r * 100.0 / 16rFFFF)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9289
		value:(g * 100.0 / 16rFFFF)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9290
		value:(b * 100.0 / 16rFFFF)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9291
    ].
4074
b40ae99d0f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  9292
    "/ 'get RGB' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9293
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9294
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9295
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9296
getRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9297
    "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
  9298
     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
  9299
     Return nil for unknown color names."
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9300
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9301
    |val|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9302
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9303
    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
  9304
	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
  9305
	val := aBlock
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9306
		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
  9307
		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
  9308
		value:(b * 100.0 / 16rFFFF)
5338
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9309
    ].
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9310
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9311
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9312
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9313
getScaledRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9314
    "get rgb components (0 .. 16rFFFF) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9315
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9316
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9317
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9318
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9319
    int id = __intVal(index);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9320
    int iR, iG, iB;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9321
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9322
    id = st2RGB(id,0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9323
    iR = id & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9324
    iG = (id >> 8) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9325
    iB = (id >> 16) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9326
    iR = (iR << 8) | iR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9327
    iG = (iG << 8) | iG;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9328
    iB = (iB << 8) | iB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9329
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9330
    r = __MKSMALLINT(iR);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9331
    g = __MKSMALLINT(iG);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9332
    b = __MKSMALLINT(iB);
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9333
    /*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
  9334
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9335
    ^ aBlock value:r value:g value:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9336
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9337
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9338
getScaledRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9339
    "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
  9340
     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
  9341
     Return nil for unknown color names."
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9342
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  9343
    |triple r g b found cName|
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9344
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9345
    r := g := b := 0.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9346
    found := false.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9347
    (colorName startsWith:$#) ifTrue:[
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9348
	"/ color in r/g/b hex notation
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9349
	r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9350
	g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9351
	b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9352
	found := true.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9353
    ] ifFalse:[
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9354
	cName := colorName asString.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9355
	triple := StandardColorValues at:cName ifAbsent:nil.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9356
	triple isNil ifTrue:[
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9357
	    "/ try lowercase name
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9358
	    cName := cName asLowercase.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9359
	    triple := StandardColorValues at:cName ifAbsent:nil.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9360
	    triple isNil ifTrue:[
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9361
		"/ try lowercase without intermixed spaces
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9362
		cName := cName asCollectionOfWords asStringWith:nil.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9363
		triple := StandardColorValues at:cName ifAbsent:nil.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9364
	    ].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9365
	].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9366
	triple notNil ifTrue:[
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9367
	    r := triple at:1.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9368
	    g := triple at:2.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9369
	    b := triple at:3.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9370
	    found := true.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9371
	].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9372
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9373
    found ifFalse:[
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9374
	"/ ('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9375
	^ nil.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9376
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9377
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9378
    ^ aBlock value:((r * 256) + r) value:((g * 256) + g) value:((b * 256) + b)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9379
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9380
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9381
listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9382
    "return a list of all available colornames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9383
     This should not be used, since colornames are very
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9384
     display-specific (here X-specific)."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9385
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9386
    |aStream list line index colorName|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9387
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9388
    aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9389
    aStream isNil ifTrue:[^ nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9390
    list := OrderedCollection new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9391
    [aStream atEnd] whileFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9392
	line := aStream nextLine.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9393
	line notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9394
	    "skip the r/g/b numbers"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9395
	    index := 1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9396
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9397
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9398
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9399
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9400
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9401
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9402
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9403
	    colorName := line copyFrom:index.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9404
	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9405
		list add:colorName
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9406
	    ]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9407
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9408
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9409
    aStream close.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9410
    ^ list sort
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9411
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9412
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9413
     Screen current listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9414
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9415
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9416
    "Modified: 11.9.1996 / 15:26:28 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9417
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9418
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9419
percentToDeviceColorValue:aPercentage
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9420
    "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
  9421
     WIN-component value (0..16rFFFF) as an integer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9422
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9423
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9424
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9425
    if (__isSmallInteger(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9426
	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9427
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9428
    if (__isFloat(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9429
	RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9430
    }
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
    ^ (16rFFFF * aPercentage / 100) rounded
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9433
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9434
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9435
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
  9436
    "change a palette index.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9437
     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
  9438
     - 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
  9439
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9440
     '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
  9441
     ^ self.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9442
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9443
    "Created: 30.1.1998 / 09:27:48 / md"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9444
    "Modified: 30.1.1998 / 09:30:22 / md"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9445
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9446
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9447
!WinWorkstation methodsFor:'cursor stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9448
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9449
builtInCursorShapes
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9450
    "return a collection of standard cursor names.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9451
     Those are built into Windows and need not be created as
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9452
     user cursors.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9453
     (actually, there are more than those below ...)"
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9454
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9455
    "/ if you add something here, also add to #shapeNumberFromCursor ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9456
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9457
    ^ #(
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9458
	#upLeftArrow            "/ IDC_ARROW
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9459
	#upDownArrow            "/ IDC_SIZENS
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9460
	#leftRightArrow         "/ IDC_SIZEWE
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9461
	#text                   "/ IDC_IBEAM
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9462
	#wait                   "/ IDC_WAIT
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9463
	#execute                "/ IDC_APPSTARTING
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9464
	#crossHair              "/ IDC_CROSS
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9465
	#fourWay                "/ IDC_SIZEALL
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9466
	#upRightHand            "/ IDC_ARROW
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9467
	#noDrop                 "/ IDC_NO
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9468
	#stop                   "/ IDC_NO
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9469
       )
3110
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9470
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9471
    "Modified: / 10.12.1999 / 15:16:26 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9472
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9473
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9474
createCursorShape:aShape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9475
    "create a cursor given a shape-symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9476
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9477
    |number|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9478
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9479
    number := self shapeNumberFromSymbol:aShape.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9480
    number isNil ifTrue:[^ nil].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9481
    ^ self primCreateCursorShapeNr:number
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9482
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9483
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9484
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
  9485
    "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
  9486
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9487
    |padding bpl bplPadded srcOffs dstOffs
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9488
     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
  9489
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9490
    cW := self getSystemMetrics:#SM_CXCURSOR.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9491
    cH := self getSystemMetrics:#SM_CYCURSOR.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9492
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9493
    "/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9494
    src := sourceBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9495
    mask := maskBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9496
    padding := self cursorBitmapPadding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9497
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9498
    "/ repadding and/or resizing required ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9499
    bpl := sourceBytes size / h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9500
    bplPadded := (cW + padding - 1) // padding * 2.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9501
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9502
    bpl ~~ bplPadded ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9503
	 "/     'repad cursor bits' infoPrintCR.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9504
	srcPadded := ByteArray new:(bplPadded * cH).
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9505
	nB := bpl min: bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9506
	nR := cH min: h.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9507
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9508
	dstOffs := srcOffs := 1.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9509
	1 to:nR do:[:row |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9510
	    srcPadded
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9511
		replaceFrom:dstOffs
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9512
		to:(dstOffs+nB-1)
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9513
		with:src
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9514
		startingAt:srcOffs.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9515
	    dstOffs := dstOffs + bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9516
	    srcOffs := srcOffs + bpl.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9517
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9518
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9519
	maskPadded := ByteArray new:(bplPadded * cH).
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9520
	dstOffs := srcOffs := 1.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9521
	1 to:nR do:[:row |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9522
	    maskPadded
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9523
		replaceFrom:dstOffs
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9524
		to:(dstOffs+nB-1)
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9525
		with:mask
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9526
		startingAt:srcOffs.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9527
	    dstOffs := dstOffs + bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9528
	    srcOffs := srcOffs + bpl.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9529
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9530
	src := srcPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9531
	mask := maskPadded.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9532
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9533
    ].
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9534
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9535
    src invert.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9536
    1 to:src size do:[:index |
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9537
	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
  9538
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9539
    mask invert.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9540
    cursor := self
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9541
	primCreateCursorSourceBits:src
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9542
	maskBits:mask
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9543
	hotX:hx hotY:hy
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9544
	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
  9545
    cursor notNil ifTrue:[^ cursor ].
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9546
    'WinWorkstation [warning]: could not create bitmap cursor' infoPrintCR.
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9547
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9548
    "Modified: / 08-09-2006 / 15:39:42 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9549
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9550
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9551
cursorBitmapPadding
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9552
    ^ 16 "/ windows requires short-padded rows
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9553
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9554
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9555
destroyCursor:aCursorId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9556
    "destroy a cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9557
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9558
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9559
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9560
    if (ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9561
	if (__isExternalAddress(aCursorId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9562
	    HCURSOR curs = _HCURSORVal(aCursorId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9563
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9564
	    if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9565
#ifdef KEEP_STD_CURSORS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9566
		if ((curs != H_C_ARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9567
		 && (curs != H_C_CROSS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9568
		 && (curs != H_C_IBEAM)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9569
		 && (curs != H_C_ICON)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9570
		 && (curs != H_C_NO)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9571
		 && (curs != H_C_SIZE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9572
		 && (curs != H_C_SIZEALL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9573
		 && (curs != H_C_SIZENESW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9574
		 && (curs != H_C_SIZENS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9575
		 && (curs != H_C_SIZENWSE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9576
		 && (curs != H_C_UPARROW)
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9577
		 && (curs != H_C_APPSTARTING)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9578
		 && (curs != H_C_WAIT))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9579
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9580
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9581
		    DestroyCursor(curs);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9582
#ifdef COUNT_RESOURCES
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9583
		    __cnt_cur--;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9584
		    RESPRINTF(("DestroyCursor %d\n",__cnt_cur));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9585
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9586
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9587
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9588
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9589
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9590
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9591
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9592
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9593
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9594
needDeviceFormsForCursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9595
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9596
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9597
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9598
primCreateCursorShapeNr:number
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9599
    " create a standard (shape) cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9600
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  9601
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9602
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9603
    LPCTSTR cId;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9604
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9605
    if (__isSmallInteger(number)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9606
	cId = (LPCTSTR)(__intVal(number));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9607
	newCursor = LoadCursor(NULL, cId);
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  9608
	if (newCursor) {
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  9609
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9610
	    if (cId == IDC_ARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9611
		H_C_ARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9612
	    else if (cId == IDC_CROSS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9613
		H_C_CROSS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9614
	    else if (cId == IDC_IBEAM)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9615
		H_C_IBEAM = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9616
	    else if (cId == IDC_ICON)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9617
		H_C_ICON = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9618
	    else if (cId == IDC_NO)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9619
		H_C_NO = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9620
	    else if (cId == IDC_SIZE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9621
		H_C_SIZE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9622
	    else if (cId == IDC_SIZEALL)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9623
		H_C_SIZEALL = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9624
	    else if (cId == IDC_SIZENESW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9625
		H_C_SIZENESW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9626
	    else if (cId == IDC_SIZENS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9627
		H_C_SIZENS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9628
	    else if (cId == IDC_SIZENWSE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9629
		H_C_SIZENWSE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9630
	    else if (cId == IDC_UPARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9631
		H_C_UPARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9632
	    else if (cId == IDC_WAIT)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9633
		H_C_WAIT = newCursor;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9634
	    else if (cId == IDC_APPSTARTING)
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9635
		H_C_APPSTARTING = newCursor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9636
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9637
	    RETURN ( __MKOBJ(newCursor) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9638
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9639
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9640
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9641
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9642
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9643
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9644
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
  9645
    "create a cursor from given pixels"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9646
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9647
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9648
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9649
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9650
    if (__isByteArray(src)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9651
     && __isByteArray(mask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9652
     && __bothSmallInteger(hx, hy)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9653
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9654
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9655
	newCursor = CreateCursor((HANDLE) __getHInstance(),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9656
				 __intVal(hx), __intVal(hy),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9657
				 __intVal(w), __intVal(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9658
				 __ByteArrayInstPtr(mask)->ba_element,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9659
				 __ByteArrayInstPtr(src)->ba_element);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9660
	if (newCursor) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9661
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9662
	    __cnt_cur++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9663
	    RESPRINTF(("CreateCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9664
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9665
	    RETURN ( __MKOBJ(newCursor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9666
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9667
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9668
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9669
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9670
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9671
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9672
shapeNumberFromSymbol:shape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9673
    "given a shape-symbol, return the corresponding cursor-number,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9674
     or nil if no such standard cursor exists."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9675
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9676
    "this is pure Win-knowlegde - but you may easily add more"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9677
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9678
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9679
    if (shape == @symbol(upRightHand)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9680
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9681
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9682
    if (shape == @symbol(upLeftArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9683
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9684
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9685
    if (shape == @symbol(upDownArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9686
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENS));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9687
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9688
    if (shape == @symbol(leftRightArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9689
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9690
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9691
    if (shape == @symbol(text)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9692
	RETURN ( __MKSMALLINT( (INT)IDC_IBEAM));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9693
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9694
    if (shape == @symbol(wait)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9695
	RETURN ( __MKSMALLINT( (INT)IDC_WAIT));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9696
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9697
    if (shape == @symbol(crossHair)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9698
	RETURN ( __MKSMALLINT( (INT)IDC_CROSS));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9699
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9700
    if (shape == @symbol(fourWay)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9701
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9702
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9703
    if (shape == @symbol(execute)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9704
	RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9705
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9706
    if (shape == @symbol(noDrop)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9707
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
3110
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9708
    }
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9709
    if (shape == @symbol(stop)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9710
	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
  9711
    }
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9712
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9713
    if (shape == @symbol(IDC_UPARROW)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9714
	RETURN ( __MKSMALLINT( (INT)IDC_UPARROW));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9715
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9716
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9717
    if (shape == @symbol(IDC_SIZE)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9718
	RETURN ( __MKSMALLINT( (INT)IDC_SIZE));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9719
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9720
    if (shape == @symbol(IDC_SIZENWSE)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9721
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENWSE));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9722
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9723
    if (shape == @symbol(IDC_SIZENESW)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9724
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENESW));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9725
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9726
    if (shape == @symbol(IDC_NO)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9727
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9728
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9729
#ifdef IDC_HELP
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9730
    if (shape == @symbol(IDC_HELP)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9731
	RETURN ( __MKSMALLINT( (INT)IDC_HELP));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9732
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9733
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9734
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9735
"/    ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9736
    ^  nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9737
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9738
4461
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9739
!WinWorkstation methodsFor:'drag & drop'!
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9740
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9741
dragFinish:dropHandle
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9742
    "free Win32 data (and remove the drop-file)"
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9743
%{
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9744
    if (__isExternalAddress(dropHandle)) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9745
	HDROP hDrop = (HDROP)__externalAddressVal(dropHandle);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9746
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9747
	__externalAddressVal(dropHandle) = 0;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9748
	if (hDrop) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9749
	    DragFinish(hDrop);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9750
	}
4461
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9751
    }
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9752
%}
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9753
! !
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9754
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9755
!WinWorkstation methodsFor:'drawing'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9756
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9757
copyFromId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9758
		width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9759
    "do a bit-blt; copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9760
     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
  9761
     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
  9762
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9763
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9764
%{
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  9765
    struct gcData *dstGcData = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9766
    struct gcData *srcGcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9767
    HDC srcDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9768
    HDC dstDC = (HDC)0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9769
    int     dstGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9770
    HWND    dstGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9771
    HBITMAP dstGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9772
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9773
    if (! __isExternalAddress(srcGCId)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9774
     || ! __isExternalAddress(dstGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9775
	goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9776
    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9777
    srcGcData = _GCDATA(srcGCId);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9778
    dstGcData = _GCDATA(dstGCId);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9779
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9780
    if (__bothSmallInteger(w, h)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9781
     && __bothSmallInteger(srcX, srcY)
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9782
     && __bothSmallInteger(dstX, dstY)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9783
     && srcGcData
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9784
     && dstGcData) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9785
	int fun = BITBLT_COPY;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9786
	int src_fg, src_bg, dst_fg, dst_bg;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9787
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9788
	fun = dstGcData->bitbltrop2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9789
#if 0
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9790
	switch (fun) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9791
	  case BITBLT_COPY:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9792
	    console_printf("BITBLT_COPY\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9793
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9794
	  case BITBLT_COPYINVERTED:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9795
	    console_printf("BITBLT_COPYINVERTED\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9796
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9797
	  case BITBLT_XOR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9798
	    console_printf("BITBLT_XOR\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9799
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9800
	  case BITBLT_AND:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9801
	    console_printf("BITBLT_AND\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9802
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9803
	  case BITBLT_OR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9804
	    console_printf("BITBLT_OR\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9805
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9806
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9807
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9808
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9809
	/*
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9810
	 * a scroll operation ?
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9811
	 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9812
	if (srcGcData->hWnd
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9813
	 && ((srcGcData->hWnd == dstGcData->hWnd)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9814
	 && (fun == BITBLT_COPY))) {
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  9815
	    RECT rec, updRect;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9816
	    RECT invRec;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9817
	    HRGN updRgn = 0, dstRgn = 0, nUpdRgn = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9818
	    int _srcX = __intVal(srcX);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9819
	    int _srcY = __intVal(srcY);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9820
	    int _dstX = __intVal(dstX);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9821
	    int _dstY = __intVal(dstY);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9822
	    int _w = __intVal(w);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9823
	    int _h = __intVal(h);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9824
	    int noExpose = 0;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9825
	    int _deltaX, _deltaY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9826
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9827
#ifdef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9828
	    if (lastGcData) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9829
		_releaseDC(lastGcData);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9830
	    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9831
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9832
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9833
	    rec.left = _srcX;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9834
	    rec.top  = _srcY;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9835
	    rec.right = rec.left + _w;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9836
	    rec.bottom = rec.top + _h;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9837
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9838
	    _deltaX = _dstX - _srcX;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9839
	    _deltaY = _dstY - _srcY;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9840
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  9841
	    DDPRINTF(("dst and src is HWND %x fun == BITBLT_COPY --> scroll %d/%d\n",
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9842
		    srcGcData->hWnd,
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9843
		    _deltaX,
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9844
		    _deltaY));
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9845
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9846
	    if ((_deltaX == 0) && (_deltaY == 0)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9847
		noExpose = 1;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9848
	    } else {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9849
		updRgn = CreateRectRgn(0, 0, 0, 0);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9850
		ScrollWindowEx(srcGcData->hWnd,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9851
			    _deltaX,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9852
			    _deltaY,
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9853
			    &rec,            /* area to scroll */
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9854
			    0,               /* clip region */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9855
			    updRgn,
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9856
			    NULL, /* &invRec, */
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9857
			    0 /* SW_ERASE | SW_INVALIDATE */);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9858
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9859
		/*
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9860
		 * we are not interested in the source-area;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9861
		 * only care for exposed areas in the dst area.
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9862
		 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9863
		dstRgn = CreateRectRgn(_dstX, _dstY, _dstX+_w, _dstY+_h);
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9864
		nUpdRgn = CreateRectRgn(0, 0, 0, 0);
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9865
		switch (CombineRgn(nUpdRgn, updRgn, dstRgn, RGN_AND)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9866
		    case ERROR:
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9867
			_DeleteObject(nUpdRgn, __LINE__);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9868
			nUpdRgn = updRgn;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9869
			noExpose = 1;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9870
			break;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9871
		    case NULLREGION:
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9872
			noExpose = 1;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9873
			break;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9874
		    default:
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9875
			if (__generateExposes(srcGcData->hWnd, nUpdRgn, __WM_GEXPOSE, 1) <= 0) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9876
			    noExpose = 1;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9877
			}
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9878
			break;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9879
		}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9880
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9881
	    if (noExpose) {
2705
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  9882
		/*
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  9883
		 * no exposes generated - must send a NOEXPOSE
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  9884
		 */
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  9885
		enqEvent(ExposureMask, srcGcData->hWnd, __WM_NOGEXPOSE, 0, 0, 0, 0, 0, EV_NOTIME);
2705
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  9886
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9887
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9888
	    if (dstRgn) {
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  9889
		_DeleteObject(dstRgn, __LINE__);
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9890
	    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9891
	    if (nUpdRgn && (nUpdRgn != updRgn)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9892
		_DeleteObject(nUpdRgn, __LINE__);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9893
	    }
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9894
	    if (updRgn) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9895
		_DeleteObject(updRgn, __LINE__);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9896
	    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9897
	    RETURN ( self );
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9898
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9899
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9900
	fun = dstGcData->bitbltrop2;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9901
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9902
	if (0 /* fun == BITBLT_COPY */) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9903
	    src_fg = dst_fg = 0xFFFFFF;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9904
	    src_bg = dst_bg = 0x000000;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9905
	} else {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9906
	    src_fg = srcGcData->fgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9907
	    src_bg = srcGcData->bgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9908
	    dst_fg = dstGcData->fgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9909
	    dst_bg = dstGcData->bgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9910
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9911
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9912
	/*
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9913
	 * a simple copy (like scroll, but in a bitmap) ?
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9914
	 */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9915
	if ((srcGcData == dstGcData)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9916
	 && (fun == BITBLT_COPY)) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9917
	    RECT rec, uprec;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9918
	    int _srcX, _srcY;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9919
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9920
	    rec.left = _srcX = __intVal(srcX);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9921
	    rec.top = _srcY = __intVal(srcY);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9922
	    rec.right = rec.left + __intVal(w);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9923
	    rec.bottom = rec.top + __intVal(h);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9924
	    srcDC = _getDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9925
	    SetBkColor(srcDC, src_fg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9926
	    SetTextColor(srcDC, src_bg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9927
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  9928
	    DDPRINTF(("dst and src is DC %x fun == BITBLT_COPY  --> scrolling %d %d\n",srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY)));
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9929
	    ScrollDC(srcDC, __intVal(dstX)-_srcX,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9930
			    __intVal(dstY)-_srcY,
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9931
			    &rec, 0, 0, &uprec);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9932
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9933
	    SetBkColor(srcDC, srcGcData->bgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9934
	    SetTextColor(srcDC, srcGcData->fgColor);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9935
#ifndef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9936
	    _releaseDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9937
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9938
	    RETURN ( self );
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9939
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9940
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9941
#ifdef xxCACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9942
/* mhmh - this should not be needed */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9943
	if (lastGcData) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9944
	    _releaseDC(lastGcData);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9945
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9946
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9947
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9948
	if (dstGcData == srcGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9949
	    srcDC = dstDC = _getDC(dstGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9950
	} else {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9951
	    srcDC = _getDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9952
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9953
	    /*
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9954
	     * kludge - pretent nothing is cached for a moment,
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9955
	     * to avoid release in getDC below ...
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9956
	     */
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9957
#ifdef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9958
	    dstGcOwnerThreadID = lastGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9959
	    dstGcHWIN = lastGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9960
	    dstGcHBITMAP = lastGcHBITMAP;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9961
	    lastGcData = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9962
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9963
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9964
	    dstDC = _getDC(dstGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9965
	    SetBkColor(dstDC, dst_fg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9966
	    SetTextColor(dstDC, dst_bg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9967
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9968
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9969
	SetBkColor(srcDC, src_fg);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9970
	SetTextColor(srcDC, src_bg);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9971
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9972
	CPRINTF(("bitblt src f:%x b:%x",GetTextColor(srcDC),GetBkColor(srcDC)));
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9973
	CPRINTF(("dst f:%x b:%x\n",GetTextColor(dstDC),GetBkColor(dstDC)));
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9974
	if (BitBlt(dstDC,
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9975
	     __intVal(dstX), __intVal(dstY),
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9976
	     __intVal(w), __intVal(h),
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9977
	     srcDC,
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9978
	     __intVal(srcX), __intVal(srcY),
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9979
	     fun)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9980
	   == 0
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9981
	  ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9982
	    console_fprintf(stderr, "WinWorkstation [info]: ERROR in BitBlt\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9983
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9984
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9985
	if (dstGcData != srcGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9986
	    SetBkColor(dstDC, dstGcData->bgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9987
	    SetTextColor(dstDC, dstGcData->fgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9988
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9989
	SetBkColor(srcDC, srcGcData->bgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9990
	SetTextColor(srcDC, srcGcData->fgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9991
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9992
	if (srcGcData != dstGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9993
	    _releaseDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9994
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9995
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9996
#ifdef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9997
	/*
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9998
	 * kludge again - restore last-DC cache
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9999
	 */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10000
	lastGcData = dstGcData;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10001
	lastGcOwnerThreadID = dstGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10002
	lastGcHWIN = dstGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10003
	lastGcHBITMAP = dstGcHBITMAP;
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10004
#else
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10005
	_releaseDC(dstGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10006
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10007
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10008
    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 10009
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10010
 fail: ;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10011
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10012
    self primitiveFailed.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10013
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10014
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10015
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10016
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
 10017
		width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10018
    "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
 10019
     copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10020
     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
 10021
     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
 10022
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10023
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10024
    ^ self
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10025
	copyFromId:sourceId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10026
		 x:srcX y:srcY gc:srcDCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10027
		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
 10028
	     width:w height:h
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10029
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10030
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10031
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
 10032
    "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
 10033
     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
 10034
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10035
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10036
    int __x, __y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10037
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10038
    double f;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10039
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10040
    if (__isSmallInteger(startAngle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10041
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10042
    else if (__isFloat(startAngle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10043
	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
 10044
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
 10045
	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
 10046
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10047
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10048
    if (__isSmallInteger(angle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10049
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10050
    else if (__isFloat(angle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10051
	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
 10052
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
 10053
	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
 10054
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10055
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10056
    if (angle2 <= 0) {
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10057
	RETURN (self);
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10058
    }
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10059
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10060
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10061
     && __bothSmallInteger(x, y)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10062
     && __bothSmallInteger(width, height))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10063
     {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10064
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10065
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10066
	POINT p;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10067
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10068
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10069
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10070
	__x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10071
	__y = __intVal(y);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10072
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10073
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10074
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10075
	if (! GcDataGetPen(hDC, gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10076
	    DPRINTF(("displayArc: no pen\n"));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10077
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10078
	    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
 10079
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10080
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10081
	    yR = h / 2;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10082
	    if (angle2 - angle1 >= 360) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10083
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10084
		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
 10085
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10086
		double sin(), cos();
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10087
		float rad1, rad2;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10088
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10089
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10090
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10091
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10092
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10093
		angle2 = angle1 - angle2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10094
		/* sigh - compute the intersections ... */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10095
		rad1 = (angle1 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10096
		rad2 = (angle2 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10097
		xB = cos(rad1) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10098
		yB = sin(rad1) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10099
		xE = cos(rad2) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10100
		yE = sin(rad2) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10101
		xB = __x + xR - xB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10102
		yB = __y + yR - yB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10103
		xE = __x + xR - xE + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10104
		yE = __y + yR - yE + 0.5;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10105
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10106
	    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
 10107
	    Arc(hDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10108
		__x, __y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10109
		__x + w, __y + h,
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10110
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10111
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10112
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10113
	    GcDataReleasePen(hDC, gcData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10114
	}
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10115
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10116
	_releaseDC(gcData);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10117
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10118
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10119
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10120
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10121
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10122
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10123
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10124
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10125
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
 10126
    "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
 10127
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10128
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10129
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10130
     && __bothSmallInteger(x0, y0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10131
     && __bothSmallInteger(x1, y1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10132
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10133
	int __x1 = __intVal(x1), __y1 = __intVal(y1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10134
	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
 10135
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10136
/*      DPRINTF(("displayLine: %d/%d -> %d/%d\n",
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10137
		    __intVal(x0), __intVal(y0),
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10138
		    __x1, __y1));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10139
*/
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10140
	if (! GcDataGetPen(hDC, gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10141
	    DPRINTF(("displayLine: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10142
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10143
	    MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10144
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10145
	    LineTo(hDC, __x1, __y1);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10146
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10147
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10148
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10149
	     */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10150
	    LineTo(hDC, __x1+1, __y1);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10151
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10152
	    GcDataReleasePen(hDC, gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10153
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10154
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10155
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10156
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10157
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10158
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10159
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10160
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10161
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10162
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
 10163
    "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
 10164
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10165
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10166
    if (__isExternalAddress(aGCId)
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10167
     && __bothSmallInteger(px, py)) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10168
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10169
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10170
	POINT p;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10171
	int __x = __intVal(px), __y = __intVal(py);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10172
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10173
#ifdef OLD
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10174
	int savedLStyle = gcData->lStyle;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10175
	int savedLWidth = gcData->lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10176
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10177
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10178
	 * 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
 10179
	 */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10180
	if ((gcData->lStyle != PS_SOLID)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10181
	 || (gcData->lineWidth > 1)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10182
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10183
	    gcData->lStyle = PS_SOLID;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10184
	    gcData->lineWidth = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10185
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10186
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10187
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10188
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10189
	if (! GcDataGetPen(hDC,gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10190
	    DPRINTF(("displayPoint: no pen\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10191
	} else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10192
	    MoveToEx(hDC, __x, __y, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10193
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10194
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10195
	     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10196
	    LineTo(hDC, __x+1, __y);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10197
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10198
	    GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10199
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10200
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10201
# ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10202
	_releaseDC(gcData);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10203
# endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10204
	if ((gcData->lStyle != savedLStyle)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10205
	 || (gcData->lineWidth != savedLWidth)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10206
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10207
	    gcData->lStyle = savedLStyle;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10208
	    gcData->lineWidth = savedLWidth;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10209
	}
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10210
#else /* NEW */
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10211
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10212
	hDC = _getDC(gcData);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10213
	SetPixelV(hDC, __x, __y, gcData->fgColor);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10214
# ifndef CACHE_LAST_DC
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10215
	_releaseDC(gcData);
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10216
# endif
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10217
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10218
#endif /* NEW */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10219
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10220
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10221
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10222
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10223
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10224
displayPolygon:aPolygon in:ignoredDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10225
    "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
 10226
     which define the polygon.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10227
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10228
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10229
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10230
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10231
    numberOfPoints := aPolygon size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10232
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10233
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10234
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10235
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10236
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10237
    if (__isExternalAddress(aGCId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10238
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10239
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10240
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10241
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10242
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10243
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10244
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10245
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10246
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10247
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10248
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10249
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10250
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10251
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10252
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10253
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10254
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10255
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10256
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10257
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10258
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10259
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10260
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10261
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10262
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10263
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10264
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10265
		if (i == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10266
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10267
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10268
		    if (i == (num-1)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10269
			PolylineTo(hDC, &p, 1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10270
		    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10271
			LineTo(hDC, p.x, p.y);
4181
91439783248a bugfix: display polygon PRE_04_JUN_04
ca
parents: 4161
diff changeset
 10272
#ifdef PRE_04_JUN_04
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10273
			/*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10274
			 * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10275
			 */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10276
			LineTo(hDC, p.x+1, p.y);
4181
91439783248a bugfix: display polygon PRE_04_JUN_04
ca
parents: 4161
diff changeset
 10277
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10278
		    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10279
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10280
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10281
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10282
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10283
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10284
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10285
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10286
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10287
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10288
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10289
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10290
%}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10291
!
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10292
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10293
displayPolylines:aPolyline in:ignoredDrawableId with:aGCId
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10294
    "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
 10295
     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
 10296
     If any coordinate is not integer, an error is triggered."
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10297
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10298
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10299
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10300
    numberOfPoints := aPolyline size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10301
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10302
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10303
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10304
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10305
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10306
    if (__isExternalAddress(aGCId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10307
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10308
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10309
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10310
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10311
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10312
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10313
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10314
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10315
	    point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10316
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10317
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10318
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10319
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10320
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10321
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10322
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10323
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10324
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10325
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10326
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10327
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10328
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10329
		point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10330
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10331
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10332
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10333
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10334
		if ((i & 1) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10335
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10336
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10337
		    LineTo(hDC, p.x, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10338
		    /*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10339
		     * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10340
		     */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10341
		    LineTo(hDC, p.x+1, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10342
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10343
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10344
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10345
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10346
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10347
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10348
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10349
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10350
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10351
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10352
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10353
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10354
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10355
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10356
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
 10357
    "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
 10358
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10359
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10360
    int w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10361
    int xL, yT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10362
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10363
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10364
     && __bothSmallInteger(width, height)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10365
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10366
	HDC hDC = _getDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10367
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10368
	xL = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10369
	yT = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10370
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10371
	h = __intVal(height);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10372
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10373
	DPRINTF(("displayRectangle: %d/%d -> %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10374
			xL, yT, w, h));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10375
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10376
	if ((w >= 0) && (h >= 0)) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10377
	    if (! GcDataGetPen(hDC,gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10378
		DPRINTF(("displayRect: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10379
	    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10380
		MoveToEx(hDC, xL, yT, NULL);
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10381
#if 0
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10382
		LineTo(hDC, xL+w, yT);     // to top-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10383
		LineTo(hDC, xL+w, yT+h);   // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10384
		LineTo(hDC, xL, yT+h);     // to bot-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10385
		LineTo(hDC, xL, yT);       // back to top-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10386
#else
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10387
		LineTo(hDC, xL+w, yT);       // to top-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10388
		LineTo(hDC, xL+w, yT+h);     // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10389
		MoveToEx(hDC, xL, yT, NULL); // back to top-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10390
		LineTo(hDC, xL, yT+h);       // to bot-left
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10391
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10392
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10393
		LineTo(hDC, xL+w+1, yT+h);   // move pen one pixel more
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10394
#else
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10395
		LineTo(hDC, xL+w, yT+h);     // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10396
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10397
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10398
#endif
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10399
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10400
		GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10401
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10402
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10403
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10404
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10405
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10406
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10407
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10408
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10409
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10410
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10411
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
 10412
    "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
 10413
     foreground and background characters.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10414
     If the coordinates are not integers, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10415
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10416
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10417
    unsigned char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10418
    OBJ cls;
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
 10419
    int i1, i2, l, n;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10420
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10421
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10422
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10423
     && __isNonNilObject(aString)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10424
     && __bothSmallInteger(index1, index2)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10425
     && __bothSmallInteger(x, y))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10426
    {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10427
	struct gcData *gcData = _GCDATA(aGCId);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10428
	int pX, pY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10429
	HDC hDC = _getDC(gcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10430
	HFONT hOldFont;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10431
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10432
	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
 10433
	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
 10434
	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
 10435
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10436
	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
 10437
	    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
 10438
		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
 10439
		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
 10440
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10441
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10442
	    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
 10443
		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
 10444
		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
 10445
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10446
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10447
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10448
	/* 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
 10449
	 * 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
 10450
	 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10451
	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
 10452
	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
 10453
	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
 10454
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10455
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10456
	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
 10457
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10458
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10459
	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
 10460
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10461
	i1 = __intVal(index1) - 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10462
	i2 = __intVal(index2) - 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10463
	if (i1 >= 0 && i2 >= i1) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10464
	    cp = __stringVal(aString);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10465
	    l = i2 - i1 + 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10466
	    if (l > 32758) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10467
		/* Windows (as in XP) limits the string size for TextOut* to 32758 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10468
		l = 32758;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10469
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10470
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 10471
	    if (__isStringLike(aString)) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10472
		n = __stringSize(aString);
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
 10473
commonOutChars:
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10474
		if (i2 < n) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10475
		    cp += i1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10476
		    CPRINTF(("string1: %s pos=%d/%d l=%d hDC=%x\n", cp, pX, pY,l,hDC));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10477
		    if (! TextOutA(hDC, pX, pY, (char *)cp, l)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10478
			PRINTF(("WinWorkstation [warning]: TextOutA failed. [%d]\n", __LINE__));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10479
			PRINTF(("WinWorkstation [warning]: lastError=%d x:%d y:%d len:%d\n", GetLastError(), pX, pY, l));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10480
			goto error;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10481
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10482
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10483
		goto ret;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10484
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10485
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10486
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10487
	    cp += nInstBytes;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10488
	    n = __byteArraySize(aString) - nInstBytes;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10489
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10490
	    if (__isBytes(aString)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10491
		goto commonOutChars;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10492
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10493
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10494
	    /* Unicode */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10495
	    if (__isWords(aString)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10496
		n = n / 2;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10497
		if (i2 < n) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10498
		    WIDECHAR *w_cp = (WIDECHAR *)cp;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10499
		    w_cp += i1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10500
		    if (! TextOutW(hDC, pX, pY, w_cp, l)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10501
			PRINTF(("WinWorkstation [warning]: TextOutW failed. [%d]\n", __LINE__));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10502
			PRINTF(("WinWorkstation [warning]: lastError=%d x:%d y:%d len:%d\n", GetLastError(), pX, pY, l));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10503
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10504
		    goto ret;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10505
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10506
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10507
	}
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 10508
ret:;
4941
f9fae1143962 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4939
diff changeset
 10509
#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
 10510
	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
 10511
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10512
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10513
	SelectObject(hDC, hOldFont);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10514
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10515
#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
 10516
	_releaseDC(gcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10517
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10518
    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10519
    RETURN (self);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10520
error: ;;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10521
%}.
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 10522
    self textOutFailed.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10523
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10524
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10525
drawBits:imageBits
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10526
    bitsPerPixel:bitsPerPixel
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10527
    depth:imageDepth padding:padd
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10528
    width:imageWidth height:imageHeight
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10529
    x:srcx y:srcy
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10530
    into:ignoredDrawableId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10531
    x:dstx y:dsty
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10532
    width:w height:h
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10533
    with:aGCId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10534
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10535
    "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
 10536
     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
 10537
     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
 10538
     depth and pixel-units to be different (in theory).
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10539
     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
 10540
     depth - otherwise, primitive failure will be signalled.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10541
     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
 10542
     colors are allocated - otherwise the colors may be wrong."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10543
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10544
    (self
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10545
	primDrawBits:imageBits
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10546
	bitsPerPixel:bitsPerPixel
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10547
	depth:imageDepth
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10548
	width:imageWidth height:imageHeight
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10549
	x:srcx y:srcy
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10550
	into:ignoredDrawableId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10551
	x:dstx y:dsty
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10552
	width:w height:h
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10553
	with:aGCId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10554
	parameters:(Array with:nil with:padd with:nil with:nil with:nil)
5322
bdb7b311d584 *** empty log message ***
sr
parents: 5317
diff changeset
 10555
	"/ 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
 10556
    ) ifFalse:[
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10557
	"
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10558
	 also happens, if a segmentation violation occurs in the
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10559
	 XPutImage ...
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10560
	"
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10561
	self primitiveFailed
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10562
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10563
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10564
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10565
drawBits:imageBits
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10566
    bitsPerPixel:bitsPerPixel
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10567
    depth:imageDepth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10568
    width:imageWidth height:imageHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10569
    x:srcx y:srcy
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10570
    into:ignoredDrawableId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10571
    x:dstx y:dsty
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10572
    width:w height:h
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10573
    with:aGCId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10574
    parameters:parameters
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10575
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10576
    "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
 10577
     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
 10578
     Individual source pixels have bitsPerPixel bits, allowing to draw
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10579
     depth and pixel-units to be different (in theory).
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10580
     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
 10581
     depth - otherwise, primitive failure will be signalled.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10582
     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
 10583
     colors are allocated - otherwise the colors may be wrong."
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10584
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10585
    (self
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10586
	primDrawBits:imageBits
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10587
	bitsPerPixel:bitsPerPixel
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10588
	depth:imageDepth
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10589
	width:imageWidth height:imageHeight
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10590
	x:srcx y:srcy
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10591
	into:ignoredDrawableId
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10592
	x:dstx y:dsty
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10593
	width:w height:h
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10594
	with:aGCId
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10595
	parameters:parameters
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10596
	"/ 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
 10597
    ) ifFalse:[
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10598
	"
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10599
	 also happens, if a segmentation violation occurs in the
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10600
	 XPutImage ...
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10601
	"
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10602
	self primitiveFailed
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10603
    ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10604
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10605
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10606
fillArcX:x y:y width:width height:height from:startAngle angle:angle
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10607
	       in:ignoredDrawableId with:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10608
    "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
 10609
     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
 10610
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10611
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10612
    int __x, __y, w, h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10613
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10614
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10615
    if (__isSmallInteger(startAngle))
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10616
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10617
    else if (__isFloat(startAngle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10618
	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
 10619
    } else if (__isShortFloat(startAngle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10620
	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
 10621
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10622
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10623
    if (__isSmallInteger(angle))
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10624
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10625
    else if (__isFloat(angle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10626
	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
 10627
    } else if (__isShortFloat(angle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10628
	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
 10629
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10630
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10631
    if (angle2 <= 0) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10632
	RETURN (self);
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10633
    }
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10634
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10635
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10636
     && __bothSmallInteger(x, y)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10637
     && __bothSmallInteger(width, height))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10638
     {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10639
	struct gcData *gcData = _GCDATA(aGCId);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10640
	HDC hDC;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10641
	HBRUSH hBrush;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10642
	HPEN prevPen = 0;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10643
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10644
	w = __intVal(width);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10645
	h = __intVal(height);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10646
	__x = __intVal(x);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10647
	__y = __intVal(y);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10648
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10649
	hDC = _getDC(gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10650
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10651
	hBrush = GcDataGetBrush(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10652
	if (hBrush == 0) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10653
	    DPRINTF(("fillArc: no brush\n"));
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10654
	} else {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10655
	    HPEN hPen = 0;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 10656
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 10657
#if 0
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10658
	    hPen = GcDataGetPen(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10659
	    if (hPen == 0) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10660
		DPRINTF(("fillArc: no pen\n"));
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10661
		goto failpen;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10662
	    }
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10663
#else
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10664
	    prevPen = SelectObject(hDC, __nullPen);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10665
	    w++;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10666
	    h++;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10667
#endif
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10668
	    {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10669
		double xB, yB, xE, yE, xR, yR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10670
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10671
		xR = w / 2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10672
		yR = h / 2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10673
		if (angle2 - angle1 >= 360) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10674
		    xB = xE = __x + xR + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10675
		    yB = yE = __y /*+ yR + 0.5*/;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10676
		} else {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10677
		    double sin(), cos();
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10678
		    float rad1, rad2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10679
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10680
		    if (angle1 <= 180)
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10681
			angle1 = 180 - angle1;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10682
		    else
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10683
			angle1 = 360 + 180 - angle1;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10684
		    angle2 = angle1 - angle2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10685
		    /* sigh - compute the intersections ... */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10686
		    rad1 = (angle1 * 3.14159265359) / 180.0;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10687
		    rad2 = (angle2 * 3.14159265359) / 180.0;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10688
		    xB = cos(rad1) * xR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10689
		    yB = sin(rad1) * yR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10690
		    xE = cos(rad2) * xR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10691
		    yE = sin(rad2) * yR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10692
		    xB = __x + xR - xB + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10693
		    yB = __y + yR - yB + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10694
		    xE = __x + xR - xE + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10695
		    yE = __y + yR - yE + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10696
		}
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10697
		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
 10698
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10699
		Pie(hDC,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10700
		    __x, __y,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10701
		    __x + w + 1, __y + h + 1,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10702
		    (int)xB, (int)yB,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10703
		    (int)xE, (int)yE);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10704
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10705
		if (hPen) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10706
		    GcDataReleasePen(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10707
		}
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10708
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10709
failpen:
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10710
#ifdef CACHE_LAST_CG
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10711
	    if (prevPen) SelectObject(hDC, prevPen);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10712
#endif
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10713
	    GcDataReleaseBrush(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10714
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10715
#ifndef CACHE_LAST_DC
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10716
	_releaseDC(gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10717
#endif
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10718
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10719
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10720
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10721
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10722
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10723
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10724
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10725
fillPolygon:aPolygon in:ignoredDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10726
    "fill a polygon given by its points.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10727
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10728
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10729
    |numberOfPoints|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10730
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10731
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10732
    self
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10733
	primFillPolygon:aPolygon n:numberOfPoints
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10734
	in:ignoredDrawableId with:aGCId
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10735
!
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10736
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10737
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
 10738
    "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
 10739
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10740
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10741
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10742
    int w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10743
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10744
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10745
     && __bothSmallInteger(width, height)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10746
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10747
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10748
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10749
	if ((w >= 0) && (h >= 0)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10750
	    struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10751
	    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10752
	    HBRUSH hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10753
	    RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10754
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10755
	    hDC = _getDC(gcData);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10756
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10757
	    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
 10758
	    if (! hBrush) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10759
		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
 10760
	    } else {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10761
		rct.left = __intVal(x);
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10762
		rct.top  = __intVal(y);
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10763
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10764
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10765
		rct.right  = rct.left + w;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10766
		rct.bottom = rct.top  + h;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10767
#else
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10768
		rct.right  = rct.left + w + 1;    /* definitiv ! */
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10769
		rct.bottom = rct.top  + h + 1;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10770
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10771
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10772
		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
 10773
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10774
		/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10775
		 * for solid draws (without function), can use FillRect,
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10776
		 * which is faster and does not need a pen.
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10777
		 */
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10778
		if ((gcData->rop2 == R2_COPYPEN)
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10779
		 && (gcData->bitbltrop2 == BITBLT_COPY)) {
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10780
		    AQUIRE_DRAW_MUTEX
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10781
		    FillRect(hDC, &rct, hBrush);
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10782
		    RELEASE_DRAW_MUTEX
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10783
		    GcDataReleaseBrush(hDC, gcData);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10784
		} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10785
		    HPEN prevPen;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10786
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10787
		    prevPen = SelectObject(hDC, __nullPen);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10788
/* sigh - conflict between ST/X's Rectangle and Win32's Rectangle */
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10789
# undef Rectangle
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10790
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10791
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10792
		    Rectangle(hDC, rct.left, rct.top, rct.right +1, rct.bottom +1);
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10793
#else
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10794
		    Rectangle(hDC, rct.left, rct.top, rct.right, rct.bottom);
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10795
#endif
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10796
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10797
# define Rectangle __DEF_Rectangle
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10798
		    GcDataReleaseBrush(hDC, gcData);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10799
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10800
		    SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10801
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10802
		}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10803
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10804
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10805
	    _releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10806
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10807
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10808
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10809
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10810
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10811
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10812
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10813
primDrawBits:imageBits
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10814
	bitsPerPixel:bitsPerPixel depth:imageDepth
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10815
	width:imageWidth height:imageHeight
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10816
	x:srcx y:srcy
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10817
	into:ignoredDrawableId
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10818
	x:dstx y:dsty
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10819
	width:w height:h
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10820
	with:aGCId
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10821
	parameters:params
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10822
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10823
    |sourceAlphaOrNil padd redMask greenMask blueMask|
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10824
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10825
    "/ 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
 10826
    sourceAlphaOrNil := params at:1.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10827
    padd := params at:2.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10828
    redMask := params at:3.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10829
    greenMask := params at:4.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10830
    blueMask := params at:5.
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10831
%{
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10832
    unsigned char fastBits[10000];
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10833
    unsigned char *b_bits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10834
    unsigned char *allocatedBits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10835
    struct gcData *gcData = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10836
    HDC hDC = (HDC)0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10837
    unsigned char *__imageBits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10838
    int _sourceAlpha = 0;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10839
    int _doAlphaBlend = 0;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10840
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10841
    if (__isByteArray(imageBits)) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10842
	__imageBits = __ByteArrayInstPtr(imageBits)->ba_element;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10843
    } else if (__isExternalBytesLike(imageBits)) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10844
	__imageBits = (unsigned char *)(__externalBytesAddress(imageBits));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10845
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10846
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10847
    if (ISCONNECTED
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10848
     && __isExternalAddress(aGCId)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10849
     && __bothSmallInteger(srcx, srcy)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10850
     && __bothSmallInteger(dstx, dsty)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10851
     && __bothSmallInteger(w, h)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10852
     && __bothSmallInteger(imageWidth, imageHeight)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10853
     && __bothSmallInteger(imageDepth, bitsPerPixel)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10854
     && __isSmallInteger(padd)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10855
     && __imageBits)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10856
     {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10857
	struct
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10858
	{
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10859
	  BITMAPINFOHEADER bmiHeader;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10860
	  DWORD r;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10861
	  DWORD g;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10862
	  DWORD b;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10863
	  DWORD a;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10864
	} bitmap;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10865
	int _padd = __intVal(padd);
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10866
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10867
	gcData = _GCDATA(aGCId);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10868
	if (! gcData )
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10869
	    goto fail;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10870
	hDC = _getDC(gcData);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10871
	DDPRINTF(("hDC = %x\n", hDC));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10872
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10873
	if (_padd != WIN32PADDING) {
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10874
	    int row, col;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10875
	    unsigned char *cp;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10876
	    unsigned char *pBits;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10877
	    int b_width, b_height, bytesPerRowST, bytesPerRowWIN, padding, nBytes;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10878
	    int bi = __intVal(bitsPerPixel);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10879
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10880
	    b_width = __intVal(imageWidth);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10881
	    b_height = __intVal(imageHeight);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10882
	    bytesPerRowST = (b_width * bi + (_padd-1)) / _padd;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10883
	    bytesPerRowWIN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10884
	    padding = bytesPerRowWIN - bytesPerRowST;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10885
	    /* console_printf("padd %d bs %d bw %d p %d\n",_padd,bytesPerRowST,bytesPerRowWN,padding); */
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10886
	    if (padding) {
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10887
		nBytes = b_height * bytesPerRowWIN;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10888
		if (nBytes < sizeof(fastBits)) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10889
		    cp = b_bits = fastBits;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10890
		} else {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10891
		    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10892
		}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10893
		if (cp) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10894
		    pBits = __imageBits;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10895
		    for (row = b_height; row; row--) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10896
			for (col = bytesPerRowST; col; col--) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10897
			    *cp++ = *pBits++;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10898
			}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10899
			cp += padding;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10900
		    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10901
		} else
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10902
		    goto fail;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10903
	    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10904
	}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10905
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10906
	if (b_bits == 0) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10907
	    b_bits = __imageBits;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10908
	}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10909
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10910
	bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10911
	bitmap.bmiHeader.biPlanes = 1;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10912
	switch (__intVal(imageDepth)) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10913
	    case 16:
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10914
		/* notice the default r/g/b (STX order here) */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10915
#if 1
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10916
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10917
		bitmap.r = redMask == nil ? 0xf800 : __intVal(redMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10918
		bitmap.g = greenMask == nil ? 0x07e0 : __intVal(greenMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10919
		bitmap.b = blueMask == nil ? 0x001f : __intVal(blueMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10920
#endif
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10921
		break;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10922
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10923
	    case 24:
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10924
		/* notice the default b/g/r (WIN32 order here) */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10925
#if 0
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10926
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10927
		bitmap.r = redMask == nil ? 0xff0000 : __intVal(redMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10928
		bitmap.g = greenMask == nil ? 0x00ff00 : __intVal(greenMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10929
		bitmap.b = blueMask == nil ? 0x0000ff : __intVal(blueMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10930
#endif
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10931
		bitmap.bmiHeader.biCompression = BI_RGB;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10932
		break;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10933
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10934
	    case 32:
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10935
		/* notice the default r/g/b (STX order here) */
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10936
		bitmap.bmiHeader.biCompression = BI_RGB;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10937
#if 1
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10938
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10939
		bitmap.r = redMask == nil ? 0x0000ff : __intVal(redMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10940
		bitmap.g = greenMask == nil ? 0x00ff00 : __intVal(greenMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10941
		bitmap.b = blueMask == nil ? 0xff0000 : __intVal(blueMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10942
		bitmap.a = 0xff000000;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10943
#endif
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10944
		break;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10945
	}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10946
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10947
	if (sourceAlphaOrNil != nil) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10948
console_printf("sourceAlphaOrNil = %x\n", sourceAlphaOrNil);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10949
	    _sourceAlpha = __intVal(sourceAlphaOrNil);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10950
	    _doAlphaBlend = 1;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10951
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10952
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10953
	bitmap.bmiHeader.biSizeImage = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10954
	bitmap.bmiHeader.biXPelsPerMeter = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10955
	bitmap.bmiHeader.biYPelsPerMeter = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10956
	bitmap.bmiHeader.biClrUsed = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10957
	bitmap.bmiHeader.biClrImportant = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10958
	bitmap.bmiHeader.biWidth = __intVal(imageWidth);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10959
	bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10960
	bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10961
	/*console_printf("drawBits depth:%d bitsPerPixel:%d IW%d W:%d H:%d\n",__intVal(imageDepth),bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biWidth,__intVal(w),bitmap.bmiHeader.biHeight);*/
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10962
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10963
	if (! _doAlphaBlend) {
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10964
	    SetDIBitsToDevice(hDC,
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10965
				__intVal(dstx), __intVal(dsty),
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10966
				__intVal(w), __intVal(h),
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10967
				__intVal(srcx), __intVal(srcy),
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10968
				0, __intVal(h),
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10969
				(void *)b_bits,
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10970
				(BITMAPINFO*)&bitmap,
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10971
				DIB_RGB_COLORS);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10972
	} else {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10973
	    HDC ahdc;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10974
	    HBITMAP ahbitmap;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10975
	    void *pvBits;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10976
	    BLENDFUNCTION bf;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10977
	    static BOOL (__stdcall *P_AlphaBlend)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION );
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10978
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10979
	    if (P_AlphaBlend == 0) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10980
		/* as I dont have AlphaBlend in the inport32.lib (bcc sucks),
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10981
		 * fetch its address dynamically...
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10982
		 */
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10983
		HINSTANCE hWinGDI = LoadLibrary("msimg32.dll");
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10984
		if (hWinGDI) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10985
		    P_AlphaBlend = (BOOL (__stdcall *)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION ))
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10986
					GetProcAddress(hWinGDI, "AlphaBlend");
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10987
		}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10988
	    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10989
	    if (P_AlphaBlend != 0) {
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10990
console_printf("***********************************\n");
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10991
console_printf("_sourceAlpha = %d\n", _sourceAlpha);
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10992
		ahdc = CreateCompatibleDC(hDC);
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10993
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10994
		ahbitmap = CreateCompatibleBitmap(hDC, __intVal(imageWidth), __intVal(imageHeight));
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10995
		SelectObject(ahdc, ahbitmap);
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10996
		SetDIBitsToDevice(ahdc,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10997
				0, 0,    /* dstx, dsty */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10998
				__intVal(imageWidth), __intVal(imageHeight),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10999
				__intVal(srcx), __intVal(srcy),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11000
				0, __intVal(imageHeight),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11001
				(void *)b_bits,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11002
				(BITMAPINFO*)&bitmap,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11003
				DIB_RGB_COLORS);
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11004
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11005
		bf.BlendOp = AC_SRC_OVER;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11006
		bf.BlendFlags = 0;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11007
		bf.SourceConstantAlpha = _sourceAlpha;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11008
		bf.AlphaFormat = AC_SRC_ALPHA;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11009
#if 1
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11010
		(*P_AlphaBlend) (hDC,
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11011
				__intVal(dstx), __intVal(dsty),
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11012
				__intVal(imageWidth), __intVal(imageHeight),
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11013
				ahdc,
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11014
				0, 0,     /* srcx, srcy */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11015
				__intVal(imageWidth), __intVal(imageHeight),
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11016
				bf);
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11017
#else
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11018
		bf.SourceConstantAlpha = 255-_sourceAlpha;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11019
		bf.AlphaFormat = 0;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11020
		bf.BlendOp = 0;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11021
		(*P_AlphaBlend) (ahdc,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11022
				0, 0,     /* dstx, dsty */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11023
				__intVal(imageWidth), __intVal(imageHeight),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11024
				hDC,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11025
				__intVal(dstx), __intVal(dsty),   /* srcx, srcy */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11026
				__intVal(imageWidth), __intVal(imageHeight),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11027
				bf);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11028
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11029
		BitBlt (hDC,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11030
				__intVal(dstx), __intVal(dsty),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11031
				__intVal(imageWidth), __intVal(imageHeight),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11032
				ahdc,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11033
				0, 0,   /* srcx, srcy */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11034
				SRCCOPY);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11035
#endif
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11036
		DeleteObject(ahbitmap);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11037
		DeleteDC(ahdc);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11038
	    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11039
	}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11040
	if (allocatedBits) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11041
	    free(allocatedBits);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11042
	}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11043
#ifndef CACHE_LAST_DC
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11044
	_releaseDC(gcData);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11045
#endif
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11046
	RETURN ( true );
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11047
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11048
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11049
fail: ;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11050
    PRINTF(("create temp bitmap FAILED!!!\n"));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11051
    if (allocatedBits) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11052
	PRINTF(("freeing up temp bitmap bits ...\n"));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11053
	free(allocatedBits);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11054
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11055
#ifndef CACHE_LAST_DC
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11056
    if (hDC) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11057
	_releaseDC(gcData);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11058
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11059
#endif
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11060
%}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11061
.
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11062
    ^ false
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11063
!
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11064
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 11065
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
 11066
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11067
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11068
    OBJ point, px, py;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11069
    int i, num;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11070
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11071
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11072
     && __isSmallInteger(numberOfPoints)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11073
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11074
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11075
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 11076
	HBRUSH hBrush;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11077
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11078
	num = __intVal(numberOfPoints);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11079
	if (num < 3) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11080
	    RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11081
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11082
	for (i=0; i<num; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11083
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11084
	    if (! __isPoint(point)) goto fail;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11085
	    px = _point_X(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11086
	    py = _point_Y(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11087
	    if (! __bothSmallInteger(px, py))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11088
		goto fail;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11089
	}
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11090
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11091
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11092
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 11093
	hBrush = GcDataGetBrush(hDC,gcData);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 11094
	if (hBrush == 0) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11095
	    DPRINTF(("fillPolygon: no brush\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11096
	} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11097
	    HPEN prevPen;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11098
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11099
	    prevPen = SelectObject(hDC, __nullPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11100
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11101
	    BeginPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11102
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11103
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11104
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11105
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11106
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11107
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11108
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11109
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11110
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11111
			p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11112
			p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11113
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11114
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11115
			LineTo(hDC, __intVal(px), __intVal(py));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11116
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11117
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11118
	    }
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11119
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11120
	    EndPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11121
	    FillPath(hDC);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11122
	    GcDataReleaseBrush(hDC, gcData);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11123
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11124
	    SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11125
#endif
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11126
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11127
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11128
	_releaseDC(gcData);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11129
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11130
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11131
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11132
fail: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11133
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11134
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11135
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11136
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11137
!WinWorkstation methodsFor:'event forwarding'!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11138
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11139
activate:aBoolean view:aView
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11140
    "some view was activated/deactivated.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11141
     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
 11142
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11143
    aBoolean ifFalse:[
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11144
	activeView := nil.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11145
	self focusOutView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11146
    ] ifTrue:[
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11147
	activeView := aView.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11148
	self focusInView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11149
    ].
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11150
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11151
    "Created: / 28.4.1999 / 14:51:51 / cg"
2599
9c0749ee47ed #activate:view: via sensor
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
 11152
    "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
 11153
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11154
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11155
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
 11156
    "forward a configure for some view"
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11157
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11158
    aView realized ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11159
	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
 11160
    ]
4577
3df3646d702f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4576
diff changeset
 11161
3df3646d702f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4576
diff changeset
 11162
    "Modified: / 08-09-2006 / 19:40:18 / cg"
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11163
!
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11164
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11165
copyDataEvent:parameter eventData:dataBytes view:aView
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11166
    "forward a copyData event for some view as a client message"
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11167
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11168
    aView isNil ifTrue:[
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11169
	"/ event arrived, after I destroyed it myself
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11170
	^ self
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11171
    ].
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11172
    aView sensor
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11173
	copyDataEvent:parameter
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11174
	eventData:dataBytes
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11175
	view:aView
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11176
!
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11177
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11178
displayChange
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11179
    "the display metrics/settings have changed.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11180
     This is a speciality of windows.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11181
     TODO: Tell the viewStyle to update itself,
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11182
	   and tell all views to reinit their style.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11183
     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
 11184
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11185
    self initializeVariableScreenProperties.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11186
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11187
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11188
dropFiles:files view:view position:dropPosition handle:dropHandle
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11189
    "called when files are dropped from windows.
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11190
     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
 11191
     eventually"
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11192
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11193
"/    Transcript showCR:'Drop files:'.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11194
"/    Transcript show:'  View:'; showCR:view.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11195
"/    Transcript show:'  Position:'; showCR:dropPosition.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11196
"/    Transcript showCR:'  Files:'.
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11197
"/    files do:[:f|
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11198
"/        Transcript showCR:('    ', f printString)
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11199
"/    ].
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11200
"/
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11201
    view isNil ifTrue:[
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11202
	"/ event arrived, after I destroyed it myself
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11203
	^ self
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11204
    ].
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11205
    view sensor
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11206
	dropFiles:files view:view position:dropPosition handle:dropHandle
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11207
!
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11208
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11209
fontChange
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11210
    "the system fonts (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11211
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11212
     TODO: Tell the viewStyle to update itself,
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 11213
	   and tell all views to reinit their style.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11214
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11215
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11216
    IgnoreFontChanges ~~ true ifTrue:[
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11217
"/        'WinWorkstation [info]: fontChange ignored for now.' infoPrintCR
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11218
    ]
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11219
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11220
    "Modified: / 19.5.1999 / 23:37:17 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11221
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11222
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11223
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
 11224
    "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
 11225
     the view passed here is always the topView - not the view under the pointer.
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11226
     For compatibility with unix, we figure out the view here and pass that one down."
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11227
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11228
    |focusView|
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11229
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11230
    aView isNil ifTrue:[
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11231
	"/ event arrived, after I destroyed it myself
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11232
	^ self
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11233
    ].
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11234
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11235
    aView windowGroup notNil ifTrue:[
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11236
	focusView := aView windowGroup focusView.
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11237
    ].
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11238
    aView sensor
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11239
	mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11240
	view:(focusView ? aView)
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11241
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11242
    "Modified: / 21.5.1999 / 13:05:53 / cg"
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11243
!
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11244
4230
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11245
nativeWidgetCommand:commandId view:aView
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11246
    "forward a command event for some view.
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11247
     (Button, CheckBox etc.)"
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11248
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11249
    |sensor|
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11250
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11251
    aView isNil ifTrue:[
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11252
	"/ event arrived, after I destroyed it myself
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11253
	^ self
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11254
    ].
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11255
    sensor := aView sensor.
4249
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11256
    sensor
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11257
	nativeWidgetCommand:#'win32nativeWMCommand:'
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11258
	arguments:(Array with:commandId)
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11259
	view:aView
4230
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11260
!
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11261
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11262
queryEndSession
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11263
    "system is about to be shut down.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11264
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11265
     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
 11266
     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
 11267
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11268
    '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
 11269
    ^ true
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11270
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11271
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11272
settingsChange
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11273
    "some system settings (users preferences) have changed.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11274
     This is a speciality of windows.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11275
     For now, only a few attributes are reinitialized."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11276
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11277
    self initializeVariableSettingsProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11278
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11279
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11280
systemColorChange:aWindow
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11281
    "the system colors (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11282
     This is a speciality of windows.
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11283
     Tell the viewStyle to update itself,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11284
     and tell all view to reinit its style."
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11285
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
 11286
    |anyChange|
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
 11287
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11288
    IgnoreSysColorChanges ~~ true ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11289
	"/ first check, if there was really a change
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11290
	"/ (when exceed is running, we get plenty of those messages ...)
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11291
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11292
	SystemColorValues isNil ifTrue:[
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11293
	    SystemColorValues := IdentityDictionary new.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11294
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11295
	anyChange := false.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11296
	self supportedSystemColorKeys do:[:key |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11297
	    |oldValue newValue|
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11298
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11299
	    oldValue := SystemColorValues at:key ifAbsent:nil.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11300
	    newValue := self getSystemColor:key.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11301
	    oldValue ~= newValue ifTrue:[
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11302
		SystemColorValues at:key put:newValue.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11303
		anyChange := true.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11304
	    ]
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11305
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11306
	anyChange ifTrue:[
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11307
	    "/ TODO: this should go through the sensor ...
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11308
	    "/ ...and be handled as an event by the views thread.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11309
	    SimpleView readStyleSheetAndUpdateAllStyleCaches.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11310
	    aWindow withAllSubViewsDo:[:aView |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11311
		aView reinitStyle
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11312
	    ]
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11313
	]
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11314
    ]
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11315
4577
3df3646d702f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4576
diff changeset
 11316
    "Modified: / 08-09-2006 / 19:39:20 / cg"
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11317
!
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11318
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11319
trayAction:eventCode view:aView
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 11320
    "forward a tray event for some view."
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11321
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11322
    |sensor message arg|
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11323
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11324
    aView isNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11325
	"/ event arrived, after I destroyed it myself
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11326
	^ self
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11327
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11328
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11329
    eventCode == 512 "WM_MOUSEMOVE" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11330
	"/ mouse motion
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11331
	message := #trayMouseMotion
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11332
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11333
    eventCode == 513 "WM_LBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11334
	"/ left-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11335
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11336
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11337
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11338
    eventCode == 514 "WM_LBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11339
	"/ left-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11340
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11341
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11342
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11343
    eventCode == 515 "WM_LBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11344
	"/ left-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11345
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11346
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11347
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11348
    eventCode == 516 "WM_RBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11349
	"/ right-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11350
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11351
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11352
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11353
    eventCode == 517 "WM_RBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11354
	"/ right-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11355
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11356
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11357
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11358
    eventCode == 518 "WM_RBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11359
	"/ left-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11360
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11361
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11362
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11363
    eventCode == 519 "WM_MBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11364
	"/ middle-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11365
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11366
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11367
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11368
    eventCode == 520 "WM_MBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11369
	"/ middle-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11370
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11371
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11372
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11373
    eventCode == 521 "WM_MBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11374
	"/ middle-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11375
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11376
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11377
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11378
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11379
    message isNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11380
	Transcript showCR:eventCode.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11381
	^ self.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11382
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11383
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11384
    sensor := aView sensor.
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11385
    sensor
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11386
	trayAction:message
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11387
	arguments:(Array with:arg)
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11388
	view:aView
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11389
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11390
    "Created: / 31-10-2007 / 00:13:31 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 11391
    "Modified: / 05-11-2007 / 12:14:28 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11392
! !
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11393
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11394
!WinWorkstation methodsFor:'event forwarding-native'!
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11395
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11396
win32NativeScroll:scrollCode position:newPos view:aScrollBar
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11397
    "native scrollbar widget event."
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11398
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11399
    aScrollBar isNil ifTrue:[
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11400
	"/ event arrived, after I destroyed it myself
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11401
	^ self
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11402
    ].
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11403
4248
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11404
    self class debugNative ifTrue:[
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11405
	'WinWorkstation [info]: native scroll event' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11406
	    ' code=' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11407
	    scrollCode infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11408
	    ' position=' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11409
	    newPos infoPrintCR.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11410
    ].
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11411
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11412
    aScrollBar sensor
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11413
	nativeWidgetCommand:#win32NativeScroll:position:
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11414
	arguments:(Array with:scrollCode with:newPos) view:aScrollBar
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11415
! !
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11416
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11417
!WinWorkstation methodsFor:'event handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11418
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11419
dispatchEventFor:aViewIdOrNil withMask:eventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11420
    "central event handling method:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11421
     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
 11422
     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
 11423
     otherwise only events for the view with given id are processed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11424
     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
 11425
     handled.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11426
     WARNING: this may block to wait for an event - you better check for a
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11427
	      pending event before calling this."
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11428
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11429
    (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11430
	AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11431
	    ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11432
	] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11433
	    self dispatchLastEvent.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11434
	]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11435
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11436
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11437
    "Modified: 19.8.1997 / 17:10:42 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11438
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11439
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11440
dispatchExposeEventFor:aViewIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11441
    "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
 11442
     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
 11443
     otherwise only events for the view with given id are processed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11444
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11445
    self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11446
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11447
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11448
dispatchLastEvent
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11449
    |theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11450
     eventType|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11451
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11452
%{  /* xxSTACK: 8000 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11453
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11454
    struct queuedEvent _ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11455
    struct inlineCache *ipS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11456
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11457
    static struct inlineCache vid = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11458
    static struct inlineCache conf = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11459
    static struct inlineCache skp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11460
    static struct inlineCache skr = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11461
    static struct inlineCache exp = _ILC5;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11462
    static struct inlineCache gexpS = _ILC6;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11463
    static struct inlineCache nexpS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11464
    static struct inlineCache clr = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11465
    static struct inlineCache bp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11466
    static struct inlineCache br = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11467
    static struct inlineCache bmp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11468
    static struct inlineCache bsp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11469
    static struct inlineCache mot = _ILC4;
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 11470
    static struct inlineCache mwh = _ILC6;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11471
    static struct inlineCache unmap = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11472
    static struct inlineCache map = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11473
    static struct inlineCache termS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11474
    static struct inlineCache destr = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11475
    static struct inlineCache setCurs = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11476
    static struct inlineCache focOut = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11477
    static struct inlineCache focIn = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11478
    static struct inlineCache act = _ILC2;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11479
    static struct inlineCache pe = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11480
    static struct inlineCache pl = _ILC2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11481
    static struct inlineCache vis = _ILC1;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 11482
    static struct inlineCache sysClrChg = _ILC1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11483
    static struct inlineCache fontChg = _ILC0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 11484
    static struct inlineCache settingChg = _ILC0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11485
    static struct inlineCache qEndSess = _ILC0;
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 11486
    static struct inlineCache power = _ILC0;
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 11487
    static struct inlineCache quit = _ILC0;
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 11488
    static struct inlineCache command = _ILC2;
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11489
    static struct inlineCache trayMessage = _ILC2;
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11490
    static struct inlineCache win32NativeScroll = _ILC3;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 11491
    static struct inlineCache win32DrawItem = _ILC2;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11492
    static struct inlineCache copyData = _ILC3;
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 11493
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11494
    static struct inlineCache dropFiles = _ILC4;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11495
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11496
    int x, y, w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11497
    int keyCode, modifiers, isDoubleClick = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11498
    int isDown = 1;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11499
    int state, dir;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11500
    OBJ upDown;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11501
    OBJ eB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11502
    char nameBuffer[100];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11503
    HWND hWnd = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11504
    DDPRINTF(("dispatchLast\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11505
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11506
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11507
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11508
    if (__isByteArray(eB)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11509
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11510
    } else {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11511
	console_fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11512
	RETURN (false);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11513
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11514
    if (ev) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11515
	_ev_buf = *ev;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11516
	ev = &_ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11517
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11518
    hWnd = ev->ev_hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11519
    if (!(hWnd /*&& IsWindow(hWnd)*/)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11520
	DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11521
	RETURN (false);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11522
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11523
    {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11524
	OBJ t;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11525
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11526
	/*
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11527
	 * very often, its another event for the same view ...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11528
	 * avoid creation & lookup then.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11529
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11530
#if 1
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11531
	if ((t = __INST(lastId)) != nil) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11532
	    if (__isExternalAddress(t)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11533
		if (_HWNDVal(t) == hWnd) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11534
		    theView = __INST(lastView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11535
		    if (__isNonNilObject(theView)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11536
			if (__qClass(theView) == nil) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11537
			    theView = nil;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11538
			}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11539
		    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11540
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11541
	    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11542
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11543
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11544
	if (theView == nil) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11545
	    windowID = __MKOBJ(ev->ev_hWnd);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11546
	    theView = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, windowID);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11547
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11548
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11549
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11550
    if (theView == nil) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11551
	DPRINTF(("nil view [hWnd=%x msg=0x%x] in dispatchEvent\n",
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11552
		 ev->ev_hWnd, ev->ev_message));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11553
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11554
	RETURN (false);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11555
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11556
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11557
    switch (ev->ev_message) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11558
	    case WM_WINDOWPOSCHANGED:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11559
		{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11560
		    RECT rct;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11561
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11562
		    x = ev->ev_x;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11563
		    y = ev->ev_y;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11564
		    w = ev->ev_w;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11565
		    h = ev->ev_h;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11566
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11567
		    DPRINTF((">>> WM_WINDOWPOSCHANGED -> configure %d/%d , %d/%d\n", x,y,w,h));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11568
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11569
		    (*conf.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11570
				     @symbol(configureX:y:width:height:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11571
				     nil, &conf,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11572
				     __MKSMALLINT(x),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11573
				     __MKSMALLINT(y),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11574
				     __MKSMALLINT(w),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11575
				     __MKSMALLINT(h),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11576
				     theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11577
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11578
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11579
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11580
	    case WM_DROPFILES:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11581
		{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11582
		    HDROP hDrop = (HDROP) ev->ev_wParam;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11583
		    int   count = DragQueryFile( hDrop,0xffffffff,0,0 );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11584
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11585
		    DPRINTFIF(__debug_WM_DROPFILES__ , ("count=%d hDrop=%x\n", count, hDrop));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11586
		    if (count > 0) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11587
			OBJ  dropHandle, files, position;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11588
			char buf[MAXPATH];
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11589
			int  i;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11590
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11591
			dropHandle = __MKOBJ(hDrop);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11592
			__PROTECT__(dropHandle);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11593
			files = __ARRAY_NEW_INT( count );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11594
			__UNPROTECT__(dropHandle);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11595
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11596
			for (i = 0;i < count;i++) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11597
			    OBJ s;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11598
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11599
			    DragQueryFile(hDrop,i,buf,sizeof(buf));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11600
			    __PROTECT__(dropHandle);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11601
			    __PROTECT__(files);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11602
			    s = __MKSTRING(buf);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11603
			    __UNPROTECT__(files);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11604
			    __UNPROTECT__(dropHandle);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11605
			    __ArrayInstPtr(files)->a_element[i] = s; __STORE(files, s);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11606
			}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11607
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11608
			{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11609
			    POINT pos;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11610
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11611
			    DragQueryPoint(hDrop, &pos);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11612
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11613
			    __PROTECT__(dropHandle);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11614
			    __PROTECT__(files);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11615
			    position = __MKPOINT_INT(pos.x, pos.y);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11616
			    __UNPROTECT__(files);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11617
			    __UNPROTECT__(dropHandle);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11618
			}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11619
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11620
			(*dropFiles.ilc_func)
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11621
			    ( self
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11622
			      , @symbol(dropFiles:view:position:handle:)
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11623
			      , nil, &dropFiles,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11624
			      files, theView, position, dropHandle
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11625
			    );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11626
		    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11627
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11628
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11629
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11630
	    case WM_SHOWWINDOW:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11631
		if (ev->ev_wParam == TRUE) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11632
		    DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11633
		    arg = @symbol(unobscured);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11634
		    (*vis.ilc_func)(theView,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11635
				    @symbol(visibilityChange:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11636
				    nil, &vis, arg);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11637
		    (*map.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11638
				    @symbol(mappedView:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11639
				    nil, &map, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11640
		} else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11641
		    DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11642
#if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11643
		    arg = @symbol(fullyObscured);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11644
		    (*vis.ilc_func)(theView,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11645
				    @symbol(visibilityChange:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11646
				    nil, &vis, arg);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11647
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11648
		    (*unmap.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11649
				      @symbol(unmappedView:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11650
				      nil, &unmap, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11651
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11652
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11653
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11654
	    case __WM_ICONIFIED:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11655
		if (ev->ev_wParam) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11656
		    DPRINTF((">>> __WM_ICONIFIED -> unMappedView:\n"));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11657
#if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11658
		    arg = @symbol(fullyObscured);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11659
		    (*vis.ilc_func)(theView,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11660
				    @symbol(visibilityChange:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11661
				    nil, &vis, arg);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11662
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11663
		    (*unmap.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11664
				      @symbol(unmappedView:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11665
				      nil, &unmap, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11666
		} else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11667
		    DPRINTF((">>> __WM_DEICONIFIED -> mappedView:\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11668
		    arg = @symbol(unobscured);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11669
		    (*vis.ilc_func)(theView,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11670
				    @symbol(visibilityChange:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11671
				    nil, &vis, arg);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11672
		    (*map.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11673
				    @symbol(mappedView:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11674
				    nil, &map, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11675
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11676
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11677
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11678
	    case WM_CLOSE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11679
		DPRINTF((">>> WM_CLOSE -> terminateView:\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11680
		(*termS.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11681
				  @symbol(terminateView:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11682
				  nil, &termS, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11683
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11684
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11685
	    case WM_DESTROY:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11686
		DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11687
		(*destr.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11688
				  @symbol(destroyedView:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11689
				  nil, &destr, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11690
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11691
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11692
	    case WM_ACTIVATE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11693
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11694
		switch (LOWORD(ev->ev_wParam)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11695
		    case WA_INACTIVE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11696
			DPRINTF((">>> WM_ACTIVATE inactive h=%x\n", ev->ev_hWnd));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11697
			(*act.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11698
					@symbol(activate:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11699
					nil, &act,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11700
					false, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11701
			break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11702
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11703
		    case WA_ACTIVE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11704
		    case WA_CLICKACTIVE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11705
			DPRINTF((">>> WM_ACTIVATE active h=%x\n", ev->ev_hWnd));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11706
			(*act.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11707
					@symbol(activate:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11708
					nil, &act,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11709
					true, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11710
			break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11711
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11712
		    default:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11713
			break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11714
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11715
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11716
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11717
	    case WM_MOUSEACTIVATE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11718
		if (__debug_WM_MOUSEACTIVATE__) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11719
		    PRINTF((">>> WM_MOUSEACTIVATE h=%x -> focusInView:\n", ev->ev_hWnd));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11720
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11721
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11722
		(*focIn.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11723
				  @symbol(focusInView:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11724
				  nil, &focIn, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11725
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11726
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11727
	    case WM_SETFOCUS:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11728
		DPRINTF((">>> WM_SETFOCUS h=%x -> focusInView:\n", ev->ev_hWnd));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11729
		(*focIn.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11730
				  @symbol(focusInView:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11731
				  nil, &focIn, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11732
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11733
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11734
	    case WM_KILLFOCUS:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11735
		DPRINTF((">>> WM_KILLFOCUS h=%x -> focusOutOfView\n", ev->ev_hWnd));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11736
		(*focOut.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11737
				   @symbol(focusOutView:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11738
				   nil, &focOut, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11739
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11740
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11741
	    case __WM_GEXPOSE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11742
		x = ev->ev_x;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11743
		y = ev->ev_y;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11744
		w = ev->ev_w;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11745
		h = ev->ev_h;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11746
		DPRINTF((">>> __WM_GEXPOSE -> gExpose %d/%d -> %d/%d\n", x, y, w, h));
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11747
#if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11748
		if (GetWindow_unmapping(hWnd)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11749
		    console_fprintf(stderr, "oops - __WM_GEXPOSE for unmapping\n");
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11750
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11751
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11752
		(*gexpS.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11753
				  @symbol(graphicsExposeX:y:width:height:final:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11754
				  nil, &gexpS,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11755
				  __MKSMALLINT(x),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11756
				  __MKSMALLINT(y),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11757
				  __MKSMALLINT(w),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11758
				  __MKSMALLINT(h),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11759
				  ev->ev_wParam ? true : false,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11760
				  theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11761
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11762
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11763
	    case __WM_NOGEXPOSE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11764
		DPRINTFIF(__debug_WM_EXPOSE__, (">>> __WM_NOGEXPOSE -> noExpose\n"));
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11765
#if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11766
		if (GetWindow_unmapping(hWnd)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11767
		    console_fprintf(stderr, "oops - __WM_NOGEXPOSE for unmapping\n");
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11768
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11769
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11770
		 (*nexpS.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11771
				   @symbol(noExposeView:), nil, &nexpS,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11772
				   theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11773
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11774
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11775
# ifdef LATE_GENERATE_EXPOSE
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11776
	    case __WM_PAINT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11777
		{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11778
		    PAINTSTRUCT ps;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11779
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11780
		    AQUIRE_DRAW_MUTEX
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11781
		    __generateExposes(hWnd, NULL, WM_PAINT, 0);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11782
		    RELEASE_DRAW_MUTEX
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 11783
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11784
# if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11785
		    BeginPaint(hWnd, &ps);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11786
		    EndPaint(hWnd, &ps);
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11787
# endif
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11788
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11789
		break;
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11790
# endif
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11791
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11792
	    case WM_PAINT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11793
		x = ev->ev_x;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11794
		y = ev->ev_y;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11795
		w = ev->ev_w;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11796
		h = ev->ev_h;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11797
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11798
#if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11799
		if (GetWindow_unmapping(hWnd)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11800
		    console_fprintf(stderr, "oops - WM_PAINT for unmapping\n");
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11801
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11802
#endif
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11803
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11804
#ifndef PRE_21_NOV
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11805
		__clearWindow(hWnd, x, y, w, h);
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11806
#else
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11807
# if WM_PAINT_CLEAR_LATE
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11808
		__clearWindow(hWnd, x, y, w, h);
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11809
# endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11810
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11811
#endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11812
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11813
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS2
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11814
		{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11815
		    HDC hDC;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11816
		    HBRUSH hBrush;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11817
		    RECT rect;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11818
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11819
		    hBrush = CreateSolidBrush(BlackPixel);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11820
		    hDC = GetWindowDC(hWnd);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11821
		    SelectClipRgn(hDC, NULL);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11822
		    rect.left = x;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11823
		    rect.top = y;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11824
		    rect.right = x+w;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11825
		    rect.bottom = y+h;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11826
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11827
		    FillRect(hDC, &rect, hBrush);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11828
		    _DeleteBrush(hBrush, __LINE__);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11829
		    ReleaseDC(hWnd, hDC);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11830
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11831
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11832
		if (__debug_WM_PAINT__) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11833
		    PRINTF((">>> WM_PAINT -> expose %d/%d -> %d/%d\n", x, y, w, h));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11834
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11835
		(*exp.ilc_func)(self,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11836
			 @symbol(exposeX:y:width:height:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11837
			 nil, &exp,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11838
			 __MKSMALLINT(x),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11839
			 __MKSMALLINT(y),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11840
			 __MKSMALLINT(w),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11841
			 __MKSMALLINT(h),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11842
			 theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11843
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11844
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11845
	    case WM_LBUTTONDBLCLK:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11846
		isDoubleClick = 1;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11847
		butt = __MKSMALLINT(Button1);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11848
		goto commonButton;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11849
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11850
	    case WM_LBUTTONUP:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11851
		isDown = 0;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11852
		butt = __MKSMALLINT(Button1);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11853
		goto commonButton;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11854
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11855
	    case WM_LBUTTONDOWN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11856
		butt = __MKSMALLINT(Button1);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11857
		goto commonButton;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11858
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11859
	    case WM_MBUTTONDBLCLK:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11860
		isDoubleClick = 1;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11861
		butt = __MKSMALLINT(Button2);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11862
		goto commonButton;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11863
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11864
	    case WM_MBUTTONUP:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11865
		isDown = 0;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11866
		butt = __MKSMALLINT(Button2);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11867
		goto commonButton;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11868
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11869
	    case WM_MBUTTONDOWN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11870
		butt = __MKSMALLINT(Button2);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11871
		goto commonButton;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11872
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11873
	    case WM_RBUTTONDBLCLK:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11874
		isDoubleClick = 1;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11875
		butt = __MKSMALLINT(Button3);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11876
		goto commonButton;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11877
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11878
	    case WM_RBUTTONUP:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11879
		isDown = 0;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11880
		butt = __MKSMALLINT(Button3);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11881
		goto commonButton;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11882
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11883
	    case WM_RBUTTONDOWN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11884
		butt = __MKSMALLINT(Button3);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11885
		goto commonButton;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11886
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11887
	    commonButton:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11888
		x = ev->ev_x;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11889
		y = ev->ev_y;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11890
		modifiers = ev->ev_modifiers;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11891
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11892
		if (__INST(buttonTranslation) != nil) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11893
		    butt = __AT_(__INST(buttonTranslation), butt);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11894
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11895
		arg = butt;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11896
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11897
		__INST(altDown) = (modifiers & AltMask) ? true : false;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11898
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11899
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11900
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11901
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11902
		if (deltaDoubleClickX == -999) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11903
		    deltaDoubleClickX = GetSystemMetrics(SM_CXDOUBLECLK);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11904
		    deltaDoubleClickY = GetSystemMetrics(SM_CYDOUBLECLK);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11905
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11906
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11907
		if (isDoubleClick) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11908
		    multiClickCount = 2;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11909
		    ipS = &bmp;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11910
		    symS = @symbol(buttonMultiPress:x:y:view:);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11911
		    nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11912
		} else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11913
		    if (isDown) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11914
			if (multiClickCount
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11915
			 && (ev->ev_time < nextMultiClickTime)
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11916
			 && (butt == lastButton)
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11917
			 && (x >= (lastClickX - (deltaDoubleClickX / 2)))
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11918
			 && (x <= (lastClickX + (deltaDoubleClickX / 2)))
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11919
			 && (y >= (lastClickY - (deltaDoubleClickY / 2)))
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11920
			 && (y <= (lastClickY + (deltaDoubleClickY / 2)))
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11921
			) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11922
			    ipS = &bmp;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11923
			    symS = @symbol(buttonMultiPress:x:y:view:);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11924
			} else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11925
			    ipS = &bp;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11926
			    symS = @symbol(buttonPress:x:y:view:);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11927
			    multiClickCount = 0;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11928
			}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11929
			multiClickCount = multiClickCount + 1;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11930
			nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11931
		    } else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11932
			ipS = &br;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11933
			symS = @symbol(buttonRelease:x:y:view:);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11934
		    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11935
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11936
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11937
		if (isDown || isDoubleClick) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11938
		    lastClickX = x;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11939
		    lastClickY = y;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11940
		    lastButton = butt;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11941
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11942
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11943
		if (__debug_WM_BUTTONUP__ | __debug_WM_BUTTONDOWN__) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11944
		    if (__isSymbol(arg)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11945
			PRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11946
				    __stringVal(arg), x, y));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11947
		    } else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11948
			PRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11949
				    __intVal(arg), x, y));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11950
		    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11951
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11952
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11953
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11954
				   arg,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11955
				   __MKSMALLINT(x),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11956
				   __MKSMALLINT(y),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11957
				   theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11958
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11959
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11960
	    case __WM_MOUSEENTER:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11961
		x = ev->ev_x;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11962
		y = ev->ev_y;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11963
		state = ev->ev_modifiers;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11964
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11965
		if (__debug_WM_MOUSEENTER__) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11966
		    PRINTF((">>> WM_MOUSEENTER: %x %d/%d state:%x\n", ev->ev_hWnd, x, y, state));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11967
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11968
#if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11969
		if (GetWindow_unmapping(hWnd)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11970
		    console_fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11971
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11972
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11973
		(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11974
				    nil, &pe,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11975
				    __MKSMALLINT(state),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11976
				    __MKSMALLINT(x),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11977
				    __MKSMALLINT(y),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11978
				    theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11979
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11980
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11981
	    case __WM_MOUSELEAVE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11982
		state = ev->ev_modifiers;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11983
		if (__debug_WM_MOUSELEAVE__) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11984
		    PRINTF((">>> WM_MOUSELEAVE: %x state:%x\n", ev->ev_hWnd, state));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11985
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11986
#if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11987
		if (GetWindow_unmapping(hWnd)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11988
		    console_fprintf(stderr, "oops - WM_MOUSELEAVE for unmapping\n");
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11989
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11990
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11991
		(*pl.ilc_func)(self, @symbol(pointerLeave:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11992
				    nil, &pl,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11993
				    __MKSMALLINT(state),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11994
				    theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11995
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11996
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11997
	    case WM_MOUSEMOVE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11998
		x = ev->ev_x;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 11999
		y = ev->ev_y;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12000
		state = ev->ev_modifiers;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12001
		if (__debug_WM_MOUSEMOVE__) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12002
		    PRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12003
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12004
		(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12005
				    nil, &mot,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12006
				    __MKSMALLINT(state),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12007
				    __MKSMALLINT(x),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12008
				    __MKSMALLINT(y),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12009
				    theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12010
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12011
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 12012
#ifdef WM_MOUSEWHEEL
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12013
	    case WM_MOUSEWHEEL:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12014
		x = ev->ev_x;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12015
		y = ev->ev_y;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12016
		state = ev->ev_modifiers;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12017
		dir = ev->ev_wParam;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12018
		DPRINTF((">>> WM_MOUSEWHEEL: %d %x\n", dir, state));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12019
		{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12020
		    OBJ tim;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12021
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12022
		    __PROTECT__(theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12023
		    tim = __MKUINT(ev->ev_time);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12024
		    __UNPROTECT__(theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12025
		    (*mwh.ilc_func)(self, @symbol(mouseWheelMotion:x:y:amount:deltaTime:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12026
				    nil, &mwh,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12027
				    __MKSMALLINT(state),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12028
				    __MKSMALLINT(x),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12029
				    __MKSMALLINT(y),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12030
				    __MKSMALLINT(dir),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12031
				    tim,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12032
				    theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12033
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12034
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12035
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12036
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12037
	    case WM_CHAR:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12038
		DPRINTFIF(__debug_WM_CHAR__  , ("WM_CHAR %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12039
		DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12040
		symS = @symbol(keyPress:x:y:view:);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12041
		ipS = &skp;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12042
		upDown = true;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12043
		goto keyPressAndRelease;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12044
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12045
	    case WM_SYSKEYUP:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12046
	    case WM_KEYUP:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12047
		DPRINTFIF(__debug_WM_KEYUP__  , (">>> WM_KEYUP / SYSKEYUP: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12048
		symS = @symbol(keyRelease:x:y:view:);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12049
		ipS = &skr;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12050
		upDown = false;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12051
		goto keyPressAndRelease;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12052
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12053
	    case WM_SYSKEYDOWN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12054
	    case WM_KEYDOWN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12055
		DPRINTFIF(__debug_WM_KEYUP__  , (">>> WM_KEYDOWN / SYSKEYDOWN: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12056
		symS = @symbol(keyPress:x:y:view:);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12057
		ipS = &skp;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12058
		upDown = true;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12059
		/* FALL INTO */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12060
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12061
	    keyPressAndRelease: ;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12062
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12063
		x = ev->ev_x;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12064
		y = ev->ev_y;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12065
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12066
#ifdef NOTDEF
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12067
		{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12068
		    BYTE vKeyState[256];
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12069
		    char buff[5];
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12070
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12071
		    GetKeyboardState(vKeyState);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12072
		    ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12073
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12074
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12075
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12076
		keyCode = ev->ev_keyCode;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12077
		modifiers = ev->ev_modifiers;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12078
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12079
		if (modifiers & TRANSLATED_KEY) {
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 12080
#if 1
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12081
		    if (modifiers & ControlMask) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12082
			if (keyCode < 0x20) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12083
			    keyCode = keyCode + 'a' - 1;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12084
			    if (modifiers & ShiftMask) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12085
				keyCode = keyCode - 'a' + 'A';
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12086
			    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12087
			}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12088
		    } else if (modifiers & (MetaMask | AltMask)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12089
			if (! (modifiers & ShiftMask)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12090
			    if ((keyCode >= 'A') && (keyCode <= 'Z')) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12091
				keyCode = keyCode - 'A' + 'a';
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12092
			    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12093
			}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12094
		    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12095
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12096
		    arg = __MKSMALLINT(keyCode & 0xFFFF);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12097
		} else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12098
		    switch (keyCode) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12099
			case VK_F1:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12100
			    arg = @symbol(F1);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12101
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12102
			case VK_F2:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12103
			    arg = @symbol(F2);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12104
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12105
			case VK_F3:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12106
			    arg = @symbol(F3);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12107
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12108
			case VK_F4:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12109
			    arg = @symbol(F4);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12110
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12111
			case VK_F5:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12112
			    arg = @symbol(F5);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12113
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12114
			case VK_F6:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12115
			    arg = @symbol(F6);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12116
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12117
			case VK_F7:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12118
			    arg = @symbol(F7);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12119
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12120
			case VK_F8:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12121
			    arg = @symbol(F8);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12122
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12123
			case VK_F9:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12124
			    arg = @symbol(F9);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12125
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12126
			case VK_F10:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12127
			    arg = @symbol(F10);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12128
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12129
			case VK_F11:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12130
			    arg = @symbol(F11);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12131
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12132
			case VK_F12:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12133
			    arg = @symbol(F12);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12134
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12135
			case VK_PRIOR:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12136
			    arg = @symbol(Prior);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12137
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12138
			case VK_NEXT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12139
			    arg = @symbol(Next);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12140
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12141
			case VK_END:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12142
			    arg = @symbol(End);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12143
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12144
			case VK_HOME:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12145
			    arg = @symbol(Home);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12146
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12147
			case VK_LEFT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12148
			    arg = @symbol(CursorLeft);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12149
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12150
			case VK_RIGHT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12151
			    arg = @symbol(CursorRight);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12152
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12153
			case VK_UP:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12154
			    arg = @symbol(CursorUp);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12155
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12156
			case VK_DOWN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12157
			    arg = @symbol(CursorDown);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12158
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12159
			case VK_MENU:  /*alt key with w95 ???*/
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12160
			    arg = @symbol(Menu);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12161
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12162
			case VK_LMENU:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12163
			    arg = @symbol(Menu_L);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12164
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12165
			case VK_RMENU:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12166
			    arg = @symbol(Menu_R);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12167
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12168
			case VK_PAUSE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12169
			    arg = @symbol(Pause);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12170
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12171
			case VK_HELP:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12172
			    arg = @symbol(Help);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12173
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12174
			case VK_EXECUTE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12175
			    arg = @symbol(Execute);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12176
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12177
			case VK_CANCEL:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12178
			    arg = @symbol(Cancel);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12179
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12180
			case VK_SELECT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12181
			    arg = @symbol(Select);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12182
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12183
			case VK_PRINT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12184
			    arg = @symbol(Print);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12185
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12186
			case VK_SNAPSHOT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12187
			    arg = @symbol(Snapshot);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12188
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12189
			case VK_INSERT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12190
			    arg = @symbol(Insert);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12191
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12192
			case VK_DELETE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12193
			    arg = @symbol(Delete);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12194
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12195
			case VK_BACK:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12196
			    arg = @symbol(BackSpace);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12197
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12198
			case VK_LWIN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12199
			    arg = @symbol(Win_L);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12200
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12201
			case VK_RWIN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12202
			    arg = @symbol(Win_R);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12203
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12204
			case VK_APPS:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12205
			    arg = @symbol(Appl);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12206
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12207
			case VK_NUMPAD0:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12208
			    arg = @symbol(KeyPad0);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12209
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12210
			case VK_NUMPAD1:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12211
			    arg = @symbol(KeyPad1);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12212
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12213
			case VK_NUMPAD2:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12214
			    arg = @symbol(KeyPad2);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12215
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12216
			case VK_NUMPAD3:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12217
			    arg = @symbol(KeyPad3);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12218
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12219
			case VK_NUMPAD4:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12220
			    arg = @symbol(KeyPad4);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12221
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12222
			case VK_NUMPAD5:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12223
			    arg = @symbol(KeyPad5);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12224
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12225
			case VK_NUMPAD6:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12226
			    arg = @symbol(KeyPad6);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12227
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12228
			case VK_NUMPAD7:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12229
			    arg = @symbol(KeyPad7);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12230
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12231
			case VK_NUMPAD8:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12232
			    arg = @symbol(KeyPad8);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12233
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12234
			case VK_NUMPAD9:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12235
			    arg = @symbol(KeyPad9);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12236
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12237
			case VK_LSHIFT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12238
			    arg = @symbol(Shift_L);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12239
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12240
			case VK_RSHIFT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12241
			    arg = @symbol(Shift_R);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12242
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12243
			case VK_LCONTROL:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12244
			    arg = @symbol(Ctrl_L);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12245
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12246
			case VK_RCONTROL:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12247
			    arg = @symbol(Ctrl_R);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12248
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12249
			case VK_CONTROL:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12250
			    arg = @symbol(Ctrl);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12251
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12252
			case VK_SHIFT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12253
			    arg = @symbol(Shift);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12254
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12255
			case VK_TAB:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12256
			    arg = @symbol(Tab);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12257
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12258
			case VK_ESCAPE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12259
			    arg = @symbol(Escape);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12260
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12261
			case VK_NUMLOCK:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12262
			    arg = @symbol(NumLock);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12263
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12264
			case VK_SCROLL:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12265
			    arg = @symbol(ScrollLock);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12266
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12267
			case VK_RETURN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12268
			    arg = @symbol(Return);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12269
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12270
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12271
			default:
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12272
#if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12273
			    nameBuffer[0] = 0;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12274
			    GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12275
			    if (__debug_WM_KEYUP__ | __debug_WM_KEYDOWN__ | __debug_WM_CHAR__) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12276
				PRINTF(("char is <%d>\n", keyCode));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12277
			    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12278
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12279
			    arg = __MKSMALLINT(keyCode & 0xFFFF);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12280
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12281
		    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12282
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12283
		__INST(altDown) = (modifiers & AltMask) ? true : false;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12284
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12285
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12286
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12287
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12288
		if (__debug_WM_CHAR__ | __debug_WM_KEYUP__ | __debug_WM_KEYDOWN__) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12289
		    PRINTF(("%s: code=%x mod=%x ", __stringVal(symS), keyCode, modifiers));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12290
		    PRINTF((" alt=%d meta=%d ", __INST(altDown) == true , __INST(metaDown) == true));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12291
		    PRINTF((" sh=%d ctrl=%d", __INST(shiftDown) == true , __INST(ctrlDown) == true));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12292
		    PRINTF((" arg=%x\n", arg));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12293
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12294
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12295
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12296
				   arg,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12297
				   __MKSMALLINT(x),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12298
				   __MKSMALLINT(y),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12299
				   theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12300
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12301
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12302
	   case WM_SYSCOLORCHANGE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12303
		DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12304
		(*sysClrChg.ilc_func)(self, @symbol(systemColorChange:), nil, &sysClrChg, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12305
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12306
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12307
	   case WM_FONTCHANGE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12308
		DPRINTF((">>> WM_FONTCHANGE\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12309
		(*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12310
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12311
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12312
	   case WM_WININICHANGE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12313
		DPRINTF((">>> WM_WININICHANGE\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12314
		(*settingChg.ilc_func)(self, @symbol(settingsChange), nil, &settingChg);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12315
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12316
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12317
	   case WM_DISPLAYCHANGE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12318
		DPRINTF((">>> WM_DISPLAYCHANGE\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12319
		(*fontChg.ilc_func)(self, @symbol(displayChange), nil, &fontChg);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12320
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12321
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12322
	   case WM_QUERYENDSESSION:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12323
		DPRINTF((">>> WM_QUERYENDSESSION\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12324
		(*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12325
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12326
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12327
#ifdef LATER
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12328
	   case WM_POWER:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12329
		DPRINTF((">>> WM_POWER\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12330
		(*power.ilc_func)(self, @symbol(powerDown), nil, &power);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12331
	       break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12332
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12333
	    /* native widget actions */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12334
	    case WM_COMMAND:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12335
		DPRINTF((">>> WM_COMMAND\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12336
		(*command.ilc_func)(self, @symbol(nativeWidgetCommand:view:), nil, &command,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12337
				__MKSMALLINT(ev->ev_wParam), theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12338
	       break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12339
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12340
	    /* tray action */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12341
	    case WM_TRAY_MESSAGE:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12342
		DPRINTF((">>> WM_TRAY_MESSAGE\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12343
		(*trayMessage.ilc_func)(self, @symbol(trayAction:view:), nil, &trayMessage,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12344
				__MKSMALLINT(ev->ev_arg1), theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12345
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12346
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12347
	    /* message from another process */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12348
	    case WM_COPYDATA:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12349
		DPRINTF((">>> WM_COPYDATA\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12350
		{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12351
		    OBJ eventData;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12352
		    void *data = (void *)(ev->ev_arg1);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12353
		    int nBytes = ev->ev_arg2;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12354
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12355
		    if (ev->ev_arg1) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12356
			eventData = __MKBYTEARRAY(data, nBytes);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12357
		    } else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12358
			eventData = nil;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12359
		    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12360
		    (*copyData.ilc_func)(self, @symbol(copyDataEvent:eventData:view:), nil, &copyData,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12361
				__MKSMALLINT(ev->ev_wParam), eventData, theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12362
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12363
		break;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12364
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 12365
#ifdef LATER
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12366
	    case WM_QUIT:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12367
		DPRINTF((">>> WM_QUIT_MESSAGE\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12368
		(*quit.ilc_func)(self, @symbol(quitCommand:), nil, &quit);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12369
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12370
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12371
	    case WM_HSCROLL:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12372
	    case WM_VSCROLL:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12373
		{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12374
		    int scrollCode = 0;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12375
		    OBJ scrollCodeOrScrollCodeSymbol = nil, positionOrNil = nil;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12376
		    int pos = 0;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12377
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12378
		    scrollCode = LOWORD(ev->ev_wParam);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12379
		    scrollCodeOrScrollCodeSymbol = __MKSMALLINT(scrollCode);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12380
		    positionOrNil = nil;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12381
		    switch (scrollCode) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12382
			case SB_BOTTOM:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12383
			    scrollCodeOrScrollCodeSymbol = @symbol(SB_BOTTOM);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12384
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12385
			case SB_TOP:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12386
			    scrollCodeOrScrollCodeSymbol = @symbol(SB_TOP);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12387
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12388
			case SB_ENDSCROLL:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12389
			    scrollCodeOrScrollCodeSymbol = @symbol(SB_ENDSCROLL);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12390
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12391
			case SB_LINEDOWN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12392
			    if (ev->ev_message == WM_HSCROLL) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12393
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINERIGHT);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12394
			    } else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12395
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEDOWN);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12396
			    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12397
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12398
			case SB_LINEUP:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12399
			    if (ev->ev_message == WM_HSCROLL) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12400
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINELEFT);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12401
			    } else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12402
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEUP);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12403
			    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12404
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12405
			case SB_PAGEDOWN:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12406
			    if (ev->ev_message == WM_HSCROLL) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12407
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGERIGHT);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12408
			    } else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12409
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEDOWN);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12410
			    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12411
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12412
			case SB_PAGEUP:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12413
			    if (ev->ev_message == WM_HSCROLL) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12414
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGELEFT);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12415
			    } else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12416
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEUP);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12417
			    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12418
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12419
			case SB_THUMBPOSITION:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12420
			    if (ev->ev_message == WM_HSCROLL) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12421
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONHORIZONTAL);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12422
			    } else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12423
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONVERTICAL);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12424
			    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12425
			    pos = HIWORD(ev->ev_wParam);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12426
			    positionOrNil = __MKSMALLINT(pos);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12427
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12428
			case SB_THUMBTRACK:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12429
			    if (ev->ev_message == WM_HSCROLL) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12430
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKHORIZONTAL);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12431
			    } else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12432
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKVERTICAL);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12433
			    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12434
			    pos = HIWORD(ev->ev_wParam);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12435
			    positionOrNil = __MKSMALLINT(pos);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12436
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12437
			default:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12438
			    DPRINTF((">>> WM_SCROLL: unhandled scrollCode:%d %d\n", scrollCode));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12439
			    break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12440
		    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12441
		    NDPRINTF((">>> WM_SCROLL: %d %d\n", scrollCode, pos));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12442
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12443
		    (*win32NativeScroll.ilc_func)(self, @symbol(win32NativeScroll:position:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12444
					nil, &win32NativeScroll,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12445
					scrollCodeOrScrollCodeSymbol,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12446
					positionOrNil,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12447
					theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12448
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12449
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12450
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12451
	    case WM_DRAWITEM:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12452
		{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12453
		    NDPRINTF((">>> WM_DRAWITEM: wParam: %x\n", ev->ev_wParam));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12454
		    (*win32DrawItem.ilc_func)(self, @symbol(win32DrawItem:view:),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12455
					nil, &win32DrawItem,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12456
					__MKSMALLINT(ev->ev_wParam),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12457
					theView);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12458
		}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12459
		break;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12460
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12461
	    default:
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12462
		UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: >>> unhandled event: %x\n", ev->ev_message));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12463
		break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12464
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12465
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12466
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12467
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12468
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12469
dispatchPendingEvents
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12470
    "central event handling method for modal operation.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12471
     (i.e. this is now only used in the modal debugger)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12472
     Dispatch any pending events; return when no more are pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12473
     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
 12474
     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
 12475
     we only handle exposes until the graphicsExpose arrives.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12476
     Other systems may not need such a kludge"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12477
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12478
    [self eventPendingWithSync:false] whileTrue:[
4440
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12479
	(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
 12480
	    AbortOperationRequest handle:[:ex |
4440
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12481
		ex return
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12482
	    ] do:[
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12483
		self dispatchLastEvent.
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12484
		"/ multi-screen config: give others a chance
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12485
		"/ (needed because we run at high (non-timesliced) prio)
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12486
		Processor yield.
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12487
	    ]
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12488
	].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12489
    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12490
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12491
    "Modified: 19.8.1997 / 17:11:18 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12492
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12493
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12494
disposeEventsWithMask:aMask for:aWindowIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12495
    "dispose (throw away) specific events. If aWindowId is nil,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12496
     events matching the mask are thrown away regardless of which
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12497
     view they are for. Otherwise, only matching events for that
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12498
     view are flushed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12499
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12500
%{  /* NOCONTEXT */
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 12501
   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
 12502
   RETURN ( self );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12503
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12504
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12505
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12506
eventMaskFor:anEventSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12507
    "return the eventMask bit-constant corresponding to an event symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12508
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12509
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12510
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12511
    int m = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12512
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12513
    if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12514
    else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12515
    else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12516
    else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12517
    else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12518
    else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12519
    else if (anEventSymbol == @symbol(expose)) m = ExposureMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12520
    else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12521
    else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12522
    else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12523
    else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12524
    else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12525
    else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12526
    else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12527
    else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12528
    else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12529
    RETURN (__MKSMALLINT(m));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12530
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12531
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12532
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12533
eventPending
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12534
    "return true, if any event is pending.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12535
     This looks for both the internal queue and the display connection."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12536
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12537
    ^ self eventPendingWithSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12538
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12539
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12540
eventPending:anEventSymbol for:aWindowIdOrNil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12541
    "return true, if a specific event is pending"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12542
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12543
    ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12544
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12545
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12546
eventPendingWithSync:doSync
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12547
    "return true, if any event is pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12548
     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
 12549
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12550
    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
 12551
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12552
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12553
    if (hasEventQueued()) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12554
	RETURN (true);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12555
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12556
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12557
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12558
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12559
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12560
eventQueued
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12561
    "return true, if any event is queued"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12562
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12563
    ^ self eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12564
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12565
    "Created: 12.12.1995 / 21:43:00 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12566
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12567
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12568
eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12569
    "return true, if any event is queued internally.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12570
     (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
 12571
      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
 12572
      the display connection)."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12573
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12574
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12575
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12576
    DDPRINTF(("peek q - "));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12577
    if (hasEventQueued()) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12578
	DDPRINTF(("true\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12579
	RETURN (true);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12580
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12581
    DDPRINTF(("false\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12582
%}.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12583
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12584
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12585
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12586
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12587
    "return true, if any of the masked events is pending.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12588
     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
 12589
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12590
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12591
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 12592
    DDPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12593
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12594
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12595
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12596
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12597
exposeEventPendingFor:aWindowIdOrNil withSync:doSync
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12598
    "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
 12599
     or any view (if the arg is nil).
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12600
     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
 12601
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12602
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12603
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12604
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12605
getEventFor:aViewIdOrNil withMask:eventMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12606
    "read next event - put into local eventBuffer.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12607
     If aViewIdOrNil is nil, events for any view are fetched;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12608
     otherwise only events for that specific view will be fetched.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12609
     Returns true, if there was an event, false otherwise."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12610
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12611
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12612
    HWND win, wWanted;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12613
    int evMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12614
    OBJ eB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12615
    struct queuedEvent *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12616
    struct queuedEvent *qev;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12617
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12618
    eB = __INST(eventBuffer);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12619
    if (! __isByteArray(eB)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 12620
	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
 12621
	/* RETURN (false); */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12622
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12623
	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
 12624
	ev->ev_message = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12625
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12626
	if (__isSmallInteger(eventMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12627
	    evMask = __intVal(eventMask);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12628
	} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12629
	    evMask = ~0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12630
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12631
	if (__isExternalAddress(aViewIdOrNil)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12632
	    wWanted = _HWNDVal(aViewIdOrNil);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12633
	} else{
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12634
	    wWanted = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12635
	}
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 12636
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12637
	do { /* only to allow continue */
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12638
	    if (deqEvent(ev, wWanted, evMask)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12639
#ifdef COMPRESS_WINDOWPOSCHANGED
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12640
		if ((ev->ev_hWnd == lastPos_win)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12641
		 && (ev->ev_message == WM_WINDOWPOSCHANGED)
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12642
		 && ((ev->ev_x != lastPos_x)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12643
		     || (ev->ev_y != lastPos_y)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12644
		     || (ev->ev_w != lastPos_w)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12645
		     || (ev->ev_h != lastPos_h))) {
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12646
		    /*
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12647
		     * ignore intermediate resize events
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12648
		     * (that event is an intermediate one, because the peek-values
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12649
		     *  have already been updated for another event)
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12650
		     */
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12651
		    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
 12652
				  ev->ev_x, lastPos_x,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12653
				  ev->ev_y, lastPos_y,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12654
				  ev->ev_w, lastPos_w,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12655
				  ev->ev_h, lastPos_h ));
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12656
		    continue;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12657
		}
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12658
#endif
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12659
		RETURN ( true );
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12660
	    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12661
	} while (0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12662
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12663
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12664
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12665
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12666
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12667
handleAllEvents
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12668
    "from now on, handle any kind of event.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12669
     Always with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12670
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12671
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12672
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12673
handleExposeOnlyFor:aView
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12674
    "from now on, handle expose events only.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12675
     Never with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12676
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12677
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12678
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12679
registerHotKeyWithId:anId modifiers:aModifier virtualKeyCode:aVirtualKeyCode
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12680
    "Defines a system-wide hot key."
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12681
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12682
%{  /* NOCONTEXT */
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12683
        HWND wnd                = __rootWin;
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12684
        int hotKeyId            = __intVal(anId);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12685
        unsigned int modifier   = __intVal(aModifier);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12686
        unsigned int virtualKey = __intVal(aVirtualKeyCode);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12687
        
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12688
        if ( RegisterHotKey(wnd, hotKeyId, modifier, virtualKey) ) {
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12689
            RETURN (true);
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12690
        }
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12691
%}.
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12692
    ^ false
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12693
!
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12694
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12695
setEventMask:aMask in:aWindowId
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 12696
    "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
 12697
     is the bitwise-or of the eventMask bits (see 'eventMaskFor:')"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12698
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12699
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12700
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12701
    if (__isExternalAddress(aWindowId)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12702
     && __isSmallInteger(aMask)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12703
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12704
	int mask = __intVal(aMask);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12705
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12706
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 12707
	lI = GETLOCALWINDOWINFOPTR(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 12708
	if (lI) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12709
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12710
	    PRINTF(("new eventMask %x\n",mask));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12711
	    printMask(mask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12712
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12713
	    lI->eventMask = mask;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12714
	    RETURN ( self );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12715
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12716
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12717
%}.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12718
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12719
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12720
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12721
!WinWorkstation methodsFor:'event sending'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12722
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12723
sendKeyOrButtonEvent:typeSymbol x:xPos y:yPos keyOrButton:keySymCodeOrButtonNr state:stateMask toViewId:targetId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12724
    "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
 12725
     TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12726
     For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12727
     for key events, it can be either a symbol (as listen in X's keySyms)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12728
     or a numeric keysym code. If state is nil, the modifier bits (shift & control)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12729
     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
 12730
     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
 12731
     (not very user friendly)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12732
2672
81c4e65507df *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
 12733
    'WinWorkstation [warning]: sendKeyOrButtonEvent unimplemented' infoPrintCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12734
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12735
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12736
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12737
!WinWorkstation methodsFor:'font stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12738
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12739
createFontFor:aFontName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12740
    "a basic method for font allocation; this method allows
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12741
     any font to be aquired (even those not conforming to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12742
     standard naming conventions, such as cursor, fixed or k14)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12743
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 12744
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12745
    HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12746
    char *fn;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12747
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 12748
    if (__isStringLike(aFontName)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12749
	fn = __stringVal(aFontName);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12750
	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
 12751
	    hFont = GetStockObject(ANSI_FIXED_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12752
	} 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
 12753
	    hFont = GetStockObject(ANSI_VAR_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12754
	} else if ((strcmp(fn, "system") == 0) || (strcmp(fn, "SYSTEM_FONT") == 0)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12755
	    hFont = GetStockObject(SYSTEM_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12756
	} 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
 12757
	    hFont = GetStockObject(SYSTEM_FIXED_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12758
	} 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
 12759
	    hFont = GetStockObject(DEVICE_DEFAULT_FONT);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12760
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12761
	    hFont = GetStockObject(ANSI_FIXED_FONT);
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
	if (hFont) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 12764
	    DPRINTF(("createFontFor:%s -> %x\n", fn, hFont));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12765
	    RETURN ( __MKOBJ(hFont) );
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
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12768
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12769
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12770
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12771
5581
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 12772
encodingOf:fontId
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 12773
    "return the encoding of the font"
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 12774
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 12775
    ^ (self fontMetricsOf:fontId) encoding
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 12776
!
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 12777
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12778
fontDescriptionFromLogicalFontInfoArray:anInfoArray
5649
50c68e749917 changed: #fontDescriptionFromLogicalFontInfoArray:
Claus Gittinger <cg@exept.de>
parents: 5648
diff changeset
 12779
    |fntDescr family face style logicalSize pointSize encoding|
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12780
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 12781
    family := anInfoArray at:16.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 12782
    face   := anInfoArray at:6.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 12783
    style  := anInfoArray at:15.
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 12784
    logicalSize   := anInfoArray at:1.
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 12785
    encoding := anInfoArray at:17.
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12786
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 12787
    logicalSize := logicalSize abs.
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 12788
    "/ convert from device to point size
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 12789
    pointSize := (logicalSize / self getLogicalPixelSizeY * 72.0).
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12790
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12791
    fntDescr := FontDescription
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 12792
		    family:family
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 12793
		    face:face
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 12794
		    style:style
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 12795
		    size:pointSize
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 12796
		    sizeUnit:#pt
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 12797
		    encoding:encoding.
5198
a95b6a853a3b changed #pixelSize
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
 12798
    fntDescr setPixelSize:logicalSize.
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12799
    ^ fntDescr.
5645
760a83be3f61 changed: #fontDescriptionFromLogicalFontInfoArray:
Claus Gittinger <cg@exept.de>
parents: 5641
diff changeset
 12800
5649
50c68e749917 changed: #fontDescriptionFromLogicalFontInfoArray:
Claus Gittinger <cg@exept.de>
parents: 5648
diff changeset
 12801
    "Modified: / 09-11-2010 / 13:00:18 / cg"
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12802
!
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12803
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12804
fontMetricsOf:fontId
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12805
    "return a fonts metrics info object"
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12806
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12807
    |rawData info|
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12808
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12809
    rawData := Array new:15.
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12810
    (self primFontMetricsOf:fontId intoArray:rawData) isNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12811
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12812
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12813
    ].
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12814
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12815
    info := DeviceWorkstation::DeviceFontMetrics new.
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12816
    info
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12817
      ascent:(rawData at:1)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12818
      descent:(rawData at:2)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12819
      maxAscent:(rawData at:3)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12820
      maxDescent:(rawData at:4)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12821
      minWidth:(rawData at:5)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12822
      maxWidth:(rawData at:6)
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12823
      avgWidth:(rawData at:7)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12824
      minCode:(rawData at:8)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12825
      maxCode:16rFFFF "(rawData at:9)"
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12826
      direction:nil
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12827
      encoding:(rawData at:11).
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12828
    ^ info
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12829
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12830
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12831
fontsInFamily:aFamilyName face:aFaceName filtering:filter
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12832
    "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
 12833
     On WinWorkStations there is curently Face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12834
     But only thise matching filter (if nonNil)."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12835
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12836
    |allFonts fonts|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12837
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12838
    allFonts := self listOfAvailableFonts.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12839
    allFonts isNil ifTrue:[^ nil].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12840
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12841
    fonts := Set new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12842
    allFonts do:[:fntDescr |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12843
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12844
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12845
		fonts add:fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12846
	    ]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12847
	]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12848
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12849
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12850
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12851
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12852
getAvailableFontsMatching:pattern
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12853
    "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
 12854
    self shouldImplement.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12855
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12856
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12857
5910
da3bcd680026 added: #getDefaultFontWithEncoding:
Stefan Vogel <sv@exept.de>
parents: 5867
diff changeset
 12858
getDefaultFontWithEncoding:encoding
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12859
    "return a default font id - used when class Font cannot
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12860
     find anything usable"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12861
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12862
     ^ self createFontFor:'fixed'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12863
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12864
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12865
getFontWithFamily:familyString face:faceString
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12866
	    style:styleArgString size:sizeArg sizeUnit:sizeUnitArg
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12867
	    encoding:encoding
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12868
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12869
    "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
 12870
     font."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12871
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 12872
    |styleString theName theId xlatedStyle id spacing pxSize ptSize encodingSym|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12873
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12874
    styleString := styleArgString.
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 12875
    encoding isEmptyOrNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12876
	encodingSym := #'ms-default' "/ encoding.
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 12877
    ] ifFalse:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12878
	encodingSym := encoding asLowercase asSymbol.
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 12879
    ].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12880
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12881
    "special: if face is nil, allow access to X-fonts"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12882
    faceString isNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12883
	sizeArg notNil ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12884
	    theName := familyString , '-' , sizeArg printString
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12885
	] ifFalse:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12886
	    theName := familyString
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12887
	].
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12888
	theName notNil ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12889
	    theId := self createFontFor:theName.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12890
	].
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12891
	theId isNil ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12892
	    theId := self getDefaultFontWithEncoding:encoding
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12893
	].
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12894
	^ theId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12895
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12896
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12897
    "/ spacing other than 'normal' is contained as last component
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12898
    "/ in style
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12899
    styleString notNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12900
	((styleString endsWith:'-narrow')
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12901
	 or:[styleString endsWith:'-semicondensed']) ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12902
	    |i|
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12903
	    i := styleString lastIndexOf:$-.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12904
	    spacing := styleString copyFrom:(i+1).
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12905
	    styleString := styleString copyTo:(i-1).
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12906
	] ifFalse:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12907
	    spacing := #normal.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12908
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12909
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12910
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12911
    xlatedStyle := styleString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12912
    xlatedStyle notNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12913
	xlatedStyle := xlatedStyle first asString
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12914
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12915
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12916
    pxSize := sizeUnitArg == #px ifTrue:[sizeArg] ifFalse:[nil].
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12917
    ptSize := sizeUnitArg == #pt ifTrue:[sizeArg] ifFalse:[nil].
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12918
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12919
    id := self
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12920
	    getFontWithFoundry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12921
	    family:familyString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12922
	    weight:faceString
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12923
	    slant:styleString "/ xlatedStyle
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12924
	    spacing:spacing
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12925
	    pixelSize:pxSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12926
	    size:ptSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12927
	    registry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12928
	    encoding:encodingSym.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12929
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12930
    id isNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12931
	id := self
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12932
		getFontWithFoundry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12933
		family:familyString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12934
		weight:faceString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12935
		slant:styleString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12936
		spacing:spacing
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12937
		pixelSize:pxSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12938
		size:ptSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12939
		registry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 12940
		encoding:encodingSym.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12941
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12942
    ^ id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12943
5587
909a0413b6a2 changed: #getFontWithFamily:face:style:size:sizeUnit:encoding:
sr
parents: 5583
diff changeset
 12944
    "Modified: / 04-07-1996 / 11:38:47 / stefan"
909a0413b6a2 changed: #getFontWithFamily:face:style:size:sizeUnit:encoding:
sr
parents: 5583
diff changeset
 12945
    "Modified: / 04-08-2010 / 18:39:02 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12946
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12947
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12948
getFontWithFoundry:foundry family:family weight:weight
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12949
	      slant:slant spacing:spc pixelSize:pixelSizeOrNil size:pointSize
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12950
	      registry:registry encoding:encodingArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12951
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12952
    "get the specified font, if not available, return nil.
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12953
     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
 12954
     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
 12955
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12956
     foundry:   'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12957
     family:    'helvetica' 'courier' 'times' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12958
     weight:    'bold' 'medium' 'demi' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12959
     slant:     'r(oman)' 'i(talic)' 'o(blique)'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12960
     spacing:   'narrow' 'normal' semicondensed' ... usually '*'
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12961
     pixelSize: 16,18 ... size in pixels; usually left nil
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12962
     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
 12963
     registry:  iso8859, sgi ... '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12964
     encoding:  vendor specific encoding (usually '*')
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12965
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12966
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12967
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12968
     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
 12969
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12970
	nHeight
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12971
	nWidth
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12972
	nEscapement
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12973
	nOrientation
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12974
	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
 12975
	fdwItalic       TRUE or FALSE
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12976
	fdwUnderline    TRUE or FALSE
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12977
	fdwStrikeOut    TRUE or FALSE
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12978
	fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12979
	fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12980
	fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12981
	fdwQuality      DEFAULT, DRAFT, or PROOF.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12982
	fdwPitchAndFamily
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12983
		DEFAULT, FIXED or VARIABLE pitch
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12984
		DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12985
	lpszFace
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12986
		Typeface Name
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12987
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12988
      These two above descriptions will be matched as follows:
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12989
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12990
	foundry   - ignored
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12991
	family    - mapped to type face name.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12992
	weight    - mapped to fnWeight
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12993
	slant     - used for style
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12994
	spacing   - NOT USED INITIALLY
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12995
	pixelSize - NOT USED INITIALLY
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12996
	size      - mapped to nHeight
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12997
	registry  - NOT USED INITIALLY
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 12998
	encoding  - mapped to fdwCharSet
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12999
     "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13000
5581
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13001
    |encoding logSize heightIsCellHeight|
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13002
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13003
    encoding := encodingArg asSymbol.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13004
5171
333471dbc830 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5163
diff changeset
 13005
    pixelSizeOrNil notNil ifTrue:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13006
	logSize := pixelSizeOrNil.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13007
	heightIsCellHeight := false.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13008
    ] ifFalse:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13009
	logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13010
	heightIsCellHeight := false.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13011
    ].
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13012
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13013
    HGDIOBJ hFont;
5188
8946ef7cf787 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5184
diff changeset
 13014
    int nHeight, nWidth, nEscapement, nOrientation;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13015
    char* work;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13016
    char* work2;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13017
    DWORD fnWeight;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13018
    DWORD fdwItalic;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13019
    DWORD fdwUnderline;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13020
    DWORD fdwStrikeOut;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13021
    DWORD fdwCharSet;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13022
    DWORD fdwOutputPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13023
    DWORD fdwClipPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13024
    DWORD fdwQuality;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13025
    DWORD fdwPitchAndFamily;
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13026
    static char faceName[256];
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13027
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13028
/* INITIALIZE */
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13029
    strcpy( faceName, "NULL" );
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13030
    nHeight   = 0;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13031
    nWidth   = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13032
    nEscapement = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13033
    nOrientation = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13034
    fnWeight = FW_NORMAL;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13035
    fdwItalic = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13036
    fdwUnderline = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13037
    fdwStrikeOut = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13038
    fdwOutputPrecision = OUT_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13039
    fdwClipPrecision   = CLIP_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13040
    fdwQuality         = DEFAULT_QUALITY;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13041
    fdwPitchAndFamily  = FF_DONTCARE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13042
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13043
    fdwCharSet   = ANSI_CHARSET;
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 13044
    if ((encoding == @symbol('ms-ansi'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13045
	fdwCharSet   = ANSI_CHARSET;
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13046
    } else if (encoding == @symbol('ms-default')
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13047
	       || encoding == @symbol(*)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13048
	fdwCharSet   = DEFAULT_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13049
    } else if ((encoding == @symbol('ms-symbol'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13050
	    || (encoding == @symbol('misc-fontspecific'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13051
	fdwCharSet   = SYMBOL_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13052
    } else if ((encoding == @symbol('ms-shiftjis'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13053
	    || (encoding == @symbol('jisx0208.1983-0'))){
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13054
	fdwCharSet   = SHIFTJIS_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13055
    } else if ((encoding == @symbol('ms-gb2312'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13056
	    || (encoding == @symbol('gb2312.1980-0'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13057
	fdwCharSet   = GB2312_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13058
    } else if ((encoding == @symbol('ms-hangeul'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13059
	    || (encoding == @symbol('ksc5601.1987-0'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13060
	fdwCharSet   = HANGEUL_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13061
    } else if ((encoding == @symbol('ms-chinesebig5'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13062
	    || (encoding == @symbol('big5'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13063
	fdwCharSet   = CHINESEBIG5_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13064
    } else if (encoding == @symbol('ms-oem')) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13065
	fdwCharSet   = OEM_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13066
    } else if (encoding == @symbol('ms-johab')) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13067
	fdwCharSet   = JOHAB_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13068
    } else if ((encoding == @symbol('ms-hebrew'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13069
	    || (encoding == @symbol('ms-cp1255'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13070
	fdwCharSet   = HEBREW_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13071
    } else if ((encoding == @symbol('ms-arabic'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13072
	    || (encoding == @symbol('ms-cp1256'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13073
	fdwCharSet   = ARABIC_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13074
    } else if ((encoding == @symbol('ms-greek'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13075
	    || (encoding == @symbol('ms-cp1253'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13076
	fdwCharSet   = GREEK_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13077
    } else if ((encoding == @symbol('ms-turkish'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13078
	    || (encoding == @symbol('ms-cp1254'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13079
	fdwCharSet   = TURKISH_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13080
    } else if ((encoding == @symbol('ms-russian'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13081
	    || (encoding == @symbol('ms-cp1251'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13082
	fdwCharSet   = RUSSIAN_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13083
    } else if ((encoding == @symbol('ms-easteurope'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13084
	    || (encoding == @symbol('ms-cp1250'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13085
	fdwCharSet   = EASTEUROPE_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13086
    } else if ((encoding == @symbol('ms-baltic'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13087
	    || (encoding == @symbol('ms-cp1257'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13088
	fdwCharSet   = BALTIC_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13089
    } else if ((encoding == @symbol('ms-vietnamese'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13090
	fdwCharSet   = VIETNAMESE_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13091
    } else if ((encoding == @symbol('ms-thai'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13092
	fdwCharSet   = THAI_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13093
    } else if ((encoding == @symbol('ms-mac'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13094
	fdwCharSet   = MAC_CHARSET;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13095
#ifdef UNICODE_CHARSET
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13096
    } else if ((encoding == @symbol('ms-unicode'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13097
	fdwCharSet   = UNICODE_CHARSET;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13098
#endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13099
    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13100
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13101
    if ( __isStringLike( family ) ) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13102
	work = __stringVal( family );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13103
	if (strcmp( work, "nil" ) != 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13104
	    strncpy( faceName, work, sizeof(faceName)-1 );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13105
	}
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13106
    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13107
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 13108
    /* 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
 13109
    if( __isStringLike( weight ) ) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13110
	work = __stringVal( weight );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13111
	if (strcmp( work, "bold" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13112
	    fnWeight = FW_BOLD;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13113
	} else if (strcmp( work, "medium" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13114
	    fnWeight = FW_MEDIUM;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13115
	} else if (strcmp( work, "normal" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13116
	    fnWeight = FW_NORMAL;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13117
	} else if (strcmp( work, "light" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13118
	    fnWeight = FW_LIGHT;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13119
	} else if (strcmp( work, "demi" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13120
	    fnWeight = FW_LIGHT;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13121
	} else if (strcmp( work, "heavy" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13122
	    fnWeight = FW_HEAVY;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13123
	} else if (strcmp( work, "extraBold" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13124
	    fnWeight = FW_EXTRABOLD;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13125
	} else if (strcmp( work, "semiBold" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13126
	    fnWeight = FW_SEMIBOLD;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13127
	} else if (strcmp( work, "thin" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13128
	    fnWeight = FW_THIN;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13129
	} else if (strcmp( work, "extraLight" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13130
	    fnWeight = FW_EXTRALIGHT;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13131
	}
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13132
    } else if (__isSmallInteger(weight)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13133
	fnWeight = __intVal(weight);
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13134
    }
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13135
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13136
    if(__isSmallInteger( logSize )) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13137
	nHeight = __intVal( logSize );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13138
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13139
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13140
    if (__isStringLike(slant)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13141
	work2 = __stringVal( slant );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13142
	work  = __stringVal( slant );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13143
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13144
	if (strncmp(work2, "italic", 6) == 0)  {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13145
	    fdwItalic = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13146
	    if ( work2[6] == '-' )
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13147
		strncpy( work, &work2[7], ( strlen( work2) - 7) );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13148
	} else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13149
	    if (strncmp(work2, "oblique", 7) == 0)  {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13150
		fdwItalic = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13151
		if ( work2[7] == '-' )
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13152
		    strncpy( work, &work2[8], ( strlen( work2) - 8) );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13153
	    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13154
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13155
	if (strncmp( work, "underline", 9 ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13156
	    fdwUnderline = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13157
	    if( work[10] == '-' )
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13158
		strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13159
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13160
	if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13161
	    fdwStrikeOut = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13162
	}
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13163
    }
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13164
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13165
    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
 13166
		faceName, nHeight, nWidth, fnWeight));
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13167
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13168
    hFont = CreateFont(
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13169
			(
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13170
			    (heightIsCellHeight == true)  ?
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13171
				nHeight : -nHeight            /* positive:cell height; negative:character height */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13172
			),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13173
			nWidth,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13174
			nEscapement,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13175
			nOrientation,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13176
			fnWeight,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13177
			fdwItalic,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13178
			fdwUnderline,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13179
			fdwStrikeOut,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13180
			fdwCharSet,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13181
			fdwOutputPrecision,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13182
			fdwClipPrecision,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13183
			fdwQuality,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13184
			fdwPitchAndFamily,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13185
			faceName );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13186
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13187
    if (hFont != NULL) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13188
	DPRINTF(("createFont: %x\n", hFont));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13189
#ifdef COUNT_RESOURCES
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13190
	__cnt_font++;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13191
	RES1PRINTF(("CreateFont %d\n", __cnt_font));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13192
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13193
	RETURN ( __MKOBJ(hFont) );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13194
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13195
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13196
    DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13197
%}.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13198
    ^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13199
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13200
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13201
     Display getFontWithFoundry:'*'
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13202
			 family:'courier'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13203
			 weight:'medium'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13204
			  slant:'r'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13205
			spacing:nil
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13206
		      pixelSize:nil
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13207
			   size:13
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13208
		       registry:'iso8859'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13209
		       encoding:#*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13210
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13211
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13212
    "new NT Version: 20.2.1997 / 22:33:29 / dq"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13213
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13214
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13215
getLogicalPixelSizeY
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13216
%{
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13217
    RETURN( __MKSMALLINT(__logPixelSY) );
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13218
%}
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13219
!
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13220
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13221
listOfAvailableFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13222
    "return a list with all available fonts on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13223
     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
 13224
     next time. The elements of the returned collection are instances of
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13225
     FontDescription."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13226
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13227
    |list typeFaceList|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13228
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13229
    listOfFonts notNil ifTrue:[^ listOfFonts].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13230
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13231
    list := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13232
    typeFaceList := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13233
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13234
    [
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13235
      self primEnumFontTypesInto:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13236
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13237
      "/Transcript showCR:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13238
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13239
      typeFaceList do:[:typeFace |
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13240
	  self primEnumFontsIn:typeFace into:list.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13241
      ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13242
    ] valueUninterruptably.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13243
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13244
    "/ Transcript showCR:list.
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13245
    listOfFonts := OrderedCollection new.
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13246
    list do:[:anInfoArray |
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13247
	| fntDescr italicFontDescr |
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13248
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13249
	fntDescr := self fontDescriptionFromLogicalFontInfoArray:anInfoArray.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13250
	listOfFonts add:fntDescr.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13251
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13252
	"/ 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
 13253
	(fntDescr style startsWith:'roman') ifTrue:[
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13254
	    italicFontDescr := FontDescription
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13255
			    family:fntDescr family
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13256
			    face:fntDescr face
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13257
			    style:('italic' , (fntDescr style copyFrom:'roman' size+1))
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13258
			    size:fntDescr size
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13259
			    encoding:fntDescr encoding.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13260
	    listOfFonts add:italicFontDescr.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13261
	].
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13262
    ].
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13263
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13264
    ^ listOfFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13265
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13266
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13267
     Display listOfAvailableFonts.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13268
     Display getAvailableFontsMatching:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13269
    "
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
    "Modified: 27.9.1995 / 10:54:47 / stefan"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13272
    "Modified: 17.4.1996 / 15:27:57 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13273
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13274
5175
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13275
pixelSizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filterBlock
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13276
    "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
 13277
     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
 13278
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13279
    |sizes|
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13280
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13281
    sizes := super pixelSizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filterBlock.
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13282
    (sizes notNil and:[sizes includes:0]) ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13283
	"special: size 0 means:
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13284
	 there are scaled versions in all sizes available"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13285
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13286
	^ #(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
 13287
    ].
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13288
    ^ sizes
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13289
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13290
    "
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13291
     Display pixelSizesInFamily:'courier' face:'bold' style:'roman'
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13292
    "
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13293
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13294
    "Created: 27.2.1996 / 01:38:15 / cg"
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13295
!
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13296
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13297
primEnumFontTypesInto:typeFaceList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13298
%{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13299
    if (__tmpDC) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13300
#ifdef USE_EnumFontFamiliesEx
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13301
	EnumFontFamiliesEx( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13302
#else
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13303
	EnumFontFamilies( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList));
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13304
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13305
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13306
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13307
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13308
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13309
primEnumFontsIn:typeFace into:fontList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13310
%{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13311
    char *cp;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13312
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13313
    if (__isStringLike(typeFace)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13314
	if (__tmpDC) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13315
#ifdef USE_EnumFontFamiliesEx
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13316
	    EnumFontFamiliesEx(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13317
#else
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13318
	    EnumFontFamilies(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13319
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13320
	}
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13321
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13322
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13323
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13324
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13325
primFontMetricsOf:fontId intoArray:rawData
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13326
    "evaluate aBlock, passing a fonts metrics as arguments.
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13327
     fill passed array as:
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13328
      ascent     -> (data at:1)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13329
      descent    -> (data at:2)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13330
      maxAscent  -> (data at:3)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13331
      maxDescent -> (data at:4)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13332
      minWidth   -> (data at:5)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13333
      maxWidth   -> (data at:6)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13334
      avgWidth   -> (data at:7).
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13335
      minChar    -> (data at:8).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13336
      maxChar    -> (data at:9).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13337
      defaultChar-> (data at:10).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13338
      charSet    -> (data at:11).
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13339
"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13340
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13341
%{
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13342
    if (__isExternalAddress(fontId)
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13343
	&& __isArray(rawData)
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13344
	&& (__arraySize(rawData) >= 11)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13345
	SIZE size;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13346
	int avgWidth;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13347
	HGDIOBJ hFont;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13348
	HGDIOBJ prevFont;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13349
	TEXTMETRIC tmet;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13350
	OBJ t;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13351
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13352
	hFont = _HGDIOBJVal(fontId);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13353
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13354
	/*
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13355
	 * 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
 13356
	 */
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13357
#ifdef CACHE_LAST_TMP_FONT
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13358
	if (__tmpDC_hfont != hFont) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13359
	    prevFont = SelectObject(__tmpDC, hFont);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13360
	    if (__tmpDC_prev_hfont == NULL) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13361
		__tmpDC_prev_hfont = prevFont;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13362
	    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13363
	    __tmpDC_hfont = hFont;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13364
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13365
#else
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13366
	prevFont = SelectObject(__tmpDC, hFont);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13367
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13368
	GetTextMetricsW(__tmpDC, &tmet);
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13369
#if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13370
	{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13371
	    static char *s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13372
	    static int len;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13373
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13374
	    if (len == 0) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13375
		len = strlen(s);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13376
	    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13377
	    GetTextExtentPoint32(__tmpDC, s, len, &size);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13378
	    avgWidth = (size.cx / (len / 2) + 1) / 2;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13379
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13380
#else
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13381
	avgWidth = tmet.tmAveCharWidth;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13382
#endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13383
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13384
#ifndef CACHE_LAST_TMP_FONT
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13385
	SelectObject(__tmpDC, prevFont);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13386
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13387
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13388
	__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
 13389
	__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
 13390
	__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
 13391
	__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
 13392
	__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
 13393
	__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
 13394
	__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
 13395
	__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
 13396
	__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
 13397
	__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
 13398
	t = __charSetSymbolFor(tmet.tmCharSet);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13399
	__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
 13400
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13401
	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
 13402
		    hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13403
		    tmet.tmAveCharWidth));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13404
	RETURN (self);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13405
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13406
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13407
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13408
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13409
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13410
releaseFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13411
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13412
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13413
    if (__isExternalAddress(aFontId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13414
	HGDIOBJ hFont = _HGDIOBJVal(aFontId);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 13415
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 13416
	if (hFont) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13417
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13418
	    __cnt_font--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13419
	   RES1PRINTF(("DestroyFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13420
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13421
	   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
 13422
	   _DeleteFont(hFont, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13423
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13424
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13425
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13426
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13427
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13428
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13429
    "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
 13430
     on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13431
     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
 13432
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13433
    |sizes|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13434
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13435
    sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13436
    (sizes notNil and:[sizes includes:0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13437
	"special: in X11R5 and above, size 0 means:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13438
	 there are scaled versions in all sizes available"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13439
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13440
	^ #(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
 13441
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13442
    ^ sizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13443
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13444
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13445
     Display sizesInFamily:'courier' face:'bold' style:'roman'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13446
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13447
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13448
    "Created: 27.2.1996 / 01:38:15 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13449
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13450
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13451
widthOf:aString from:index1 to:index2 inFont:aFontId
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13452
    "leftover - bw compatibility"
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13453
    ^ self
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13454
	widthOf:aString from:index1 to:index2 inFont:aFontId
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13455
	in:nil with:nil
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13456
!
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13457
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13458
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
 13459
%{  /* NOCONTEXT */
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13460
    unsigned char *cp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13461
    int len, n, i1, i2, l;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13462
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13463
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13464
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13465
    if (__bothSmallInteger(index1, index2)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13466
     && __isExternalAddress(aFontId)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13467
     && __isNonNilObject(aString)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13468
	HGDIOBJ hFont,prevFont;
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13469
	HDC hDC;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13470
	SIZE tsize;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13471
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 13472
#define xxPRE_22_FEP_2007
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13473
#ifndef PRE_22_FEP_2007
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13474
#       define N_QUICK_CHARS    1024
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13475
	unsigned short quickWchars[N_QUICK_CHARS];
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13476
	unsigned short *wcharPtr;
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13477
	int mustFree = 0;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13478
	int i;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13479
#endif
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13480
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13481
	hFont = _HGDIOBJVal(aFontId);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13482
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13483
	if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13484
	    struct gcData *gcData = _GCDATA(aGCId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13485
	    hDC = _getDC(gcData);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13486
	    prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13487
	} else {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13488
	    hDC = __tmpDC;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13489
#ifdef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13490
	    if (__tmpDC_hfont != hFont) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13491
		prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13492
		if (__tmpDC_prev_hfont == NULL) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13493
		    __tmpDC_prev_hfont = prevFont;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13494
		}
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13495
		__tmpDC_hfont = hFont;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13496
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13497
#else
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13498
	    prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13499
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13500
	}
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13501
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13502
	i1 = __intVal(index1) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13503
	cls = __qClass(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13504
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13505
	if (i1 >= 0) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13506
	    i2 = __intVal(index2) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13507
	    if (i2 < i1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13508
		RETURN ( __MKSMALLINT( 0 ) );
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13509
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13510
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13511
	    cp = (char *) _stringVal(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13512
	    l = i2 - i1 + 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13513
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13514
	    if (__isStringLike(aString)) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13515
		n = _stringSize(aString);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13516
    commonWidthChars:
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13517
		if (i2 < n) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13518
		    cp += i1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13519
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13520
#ifdef PRE_22_FEP_2007
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13521
		    GetTextExtentPoint32(hDC, cp, l, &tsize);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13522
#else
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13523
		    if (l <= N_QUICK_CHARS) {
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13524
			wcharPtr = quickWchars;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13525
			mustFree = 0;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13526
		    } else {
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13527
			wcharPtr = malloc(sizeof(short)*l);
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13528
			if (! wcharPtr) RETURN (__MKSMALLINT(0));
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13529
			mustFree = 1;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13530
		    }
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13531
		    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
 13532
		    GetTextExtentPoint32W(hDC, wcharPtr, l, &tsize);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13533
		    if (mustFree) free(wcharPtr);
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13534
#endif
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13535
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13536
#ifdef SUPERDEBUG
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13537
		    if (__debug__) {
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13538
			char buf[80];
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13539
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13540
			GetTextFace(hDC,80,buf);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13541
			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
 13542
		    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13543
#endif
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13544
		    if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13545
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13546
		    } else {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13547
#ifndef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13548
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13549
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13550
		    }
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13551
		    RETURN ( __MKSMALLINT(tsize.cx) );
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13552
		}
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13553
		RETURN (__MKSMALLINT(0));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13554
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13555
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13556
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13557
	    cp += nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13558
	    n = __byteArraySize(aString) - nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13559
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13560
	    if (__isBytes(aString)) {
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13561
		goto commonWidthChars;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13562
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13563
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13564
	    /* Unicode */
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13565
	    if (__isWords(aString)) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13566
		n = n / 2;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13567
		if (i2 < n) {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13568
		    WIDECHAR *w_cp = (WIDECHAR *)cp;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13569
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13570
		    w_cp += i1;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13571
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13572
		    GetTextExtentPoint32W(hDC, w_cp, l, &tsize);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13573
		    if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13574
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13575
		    } else {
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13576
#ifndef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13577
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13578
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13579
		    }
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13580
		    RETURN ( __MKSMALLINT(tsize.cx) );
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13581
		}
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13582
		RETURN (__MKSMALLINT(0));
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13583
	    }
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13584
	}
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13585
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13586
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13587
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13588
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13589
4511
4430c632995a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4504
diff changeset
 13590
!WinWorkstation methodsFor:'grabbing'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13591
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13592
allowEvents:mode
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13593
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13594
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13595
grabKeyboardIn:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13596
    "grab the keyboard"
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13597
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13598
#ifdef NOT_YET_IMPLEMENTED
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13599
    if (__isExternalAddress(aWindowId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13600
      HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13601
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13602
      CPRINTF(("grabKeyboard in %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13603
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13604
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13605
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13606
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13607
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13608
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13609
    "grap the pointer - return true if ok"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13610
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13611
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13612
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13613
	HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13614
	HCURSOR hCursor = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13615
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13616
	if (__currentCapture != CAPTURE_NONE) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13617
	    PostMessage(__currentPointerView, WM_THREAD_SETCAPTURE, 0, 0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13618
	    //ReleaseCapture();
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13619
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13620
#if 1
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13621
	/*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13622
	 * place a special, invisible view above the root
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13623
	 */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13624
	if (hWnd == __rootWin) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13625
	    hWnd = __rootWinSpezial;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13626
	    ShowWindow(hWnd, SW_SHOWNOACTIVATE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13627
	    //EnableWindow(hWnd,TRUE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13628
	    SetWindowPos(hWnd, HWND_TOP,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13629
			 0, 0, 0, 0,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13630
			 SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13631
			 | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13632
	    CPRINTF(("setRootCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13633
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13634
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13635
	if (__isExternalAddress(aCursorId)) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13636
	    hCursor = _HCURSORVal(aCursorId);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13637
	    CPRINTF(("grabPointerIn  SetCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13638
	}
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13639
	PostMessage(hWnd, WM_THREAD_SETCAPTURE, (INT)hWnd, (INT)hCursor);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13640
	RETURN (true);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13641
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13642
%}.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13643
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13644
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13645
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13646
ungrabKeyboard
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13647
    "release the keyboard"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13648
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13649
    activeKeyboardGrab := nil.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13650
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13651
#ifdef NOT_YET_IMPLEMENTED
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13652
    CPRINTF(("ungrabKeyboard\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13653
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13654
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13655
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13656
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13657
ungrabPointer
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13658
    "release the pointer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13659
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13660
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13661
    CPRINTF(("ungrabPointer 1\n"));
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13662
    PostThreadMessage(_dispatchThreadId, WM_THREAD_SETCAPTURE, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13663
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13664
    activePointerGrab := nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13665
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13666
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13667
!WinWorkstation methodsFor:'graphic context stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13668
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13669
noClipIn:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13670
    "disable clipping rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13671
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13672
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13673
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13674
    if (__isExternalAddress(aWindowId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13675
     && __isExternalAddress(aGCId)) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13676
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13677
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13678
	if (gcData->clipping != FALSE) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13679
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13680
	    GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13681
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13682
	    gcData->clipping = FALSE;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13683
#ifdef CACHE_LAST_DC
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 13684
	    if (lastGcData == gcData) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13685
		SelectClipRgn(gcData->_hDC, NULL);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 13686
	    }
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 13687
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13688
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13689
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13690
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13691
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13692
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13693
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13694
setBackground:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13695
    "set background color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13696
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13697
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13698
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13699
    if (__isSmallInteger(bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13700
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13701
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13702
	COLORREF bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13703
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13704
	bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13705
	if (bgColor != gcData->bgColor) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13706
	    gcData->bgColor = bgColor;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13707
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13708
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13709
		SetBkColor(gcData->_hDC, bgColor);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13710
		/*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13711
		 * no need to flush pen - it does not depend upon
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13712
		 * the bg color
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13713
		 */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13714
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13715
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13716
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13717
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13718
	CPRINTF(("setBackground: %x\n", bgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13719
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13720
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13721
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13722
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13723
    ^self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13724
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13725
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13726
setBitmapMask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13727
    "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
 13728
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13729
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13730
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 13731
    if (__isExternalAddress(aGCId)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13732
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13733
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13734
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13735
	oldM = gcData->hMask;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13736
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 13737
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13738
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 13739
	    gcData->hMask = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13740
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13741
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13742
	    FLUSH_CACHED_DC(gcData);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13743
	    CPRINTF(("masks set to %x\n",gcData->hMask));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13744
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13745
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13746
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13747
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13748
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13749
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 13750
setClipByChildren:aBool in:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13751
    "enable/disable drawing into child views"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13752
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13753
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13754
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 13755
    if (ISCONNECTED && __isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13756
	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
 13757
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 13758
	if (gcData && gcData->hWnd) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13759
	    int newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13760
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13761
	   newClip = (aBool == true) ? TRUE : FALSE;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13762
	    if (newClip != gcData->clipByChildren) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13763
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13764
		GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13765
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13766
		/* set/clear clip by children */
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13767
		gcData->clipByChildren = newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13768
		FLUSH_CACHED_DC(gcData);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13769
	    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 13770
	} else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13771
	    DPRINTF(("clipping by child failed - invalid window\n" ));
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 13772
	}
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 13773
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13774
%}.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13775
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13776
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13777
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 13778
setClipX:clipX y:clipY width:clipWidth height:clipHeight in:ignoredDrawableId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13779
    "clip to a rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13780
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13781
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13782
      p--w---
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13783
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13784
      h     |  the clipping rectangle
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13785
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13786
      -------
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13787
	  where p = ( clipX, clipY ), w = clipWidth, h = clipHeight
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13788
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13789
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13790
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13791
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13792
    if (  __isExternalAddress(aGCId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13793
       && __bothSmallInteger(clipX, clipY)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13794
       && __bothSmallInteger(clipWidth, clipHeight) ) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13795
	struct gcData *gcData = _GCDATA(aGCId);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13796
	int cX, cY, cW, cH;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13797
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13798
	cX = __intVal(clipX);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13799
	cY = __intVal(clipY);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13800
	cW = __intVal(clipWidth);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13801
	cH = __intVal(clipHeight);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13802
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13803
	if ((gcData->clipping != TRUE)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13804
	 || (cX != gcData->clipX)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13805
	 || (cY != gcData->clipY)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13806
	 || (cW != gcData->clipW)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13807
	 || (cH != gcData->clipH)) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13808
	    gcData->clipping = TRUE;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13809
	    gcData->clipX = cX;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13810
	    gcData->clipY = cY;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13811
	    gcData->clipW = cW;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13812
	    gcData->clipH = cH;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13813
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13814
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13815
	    GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13816
#endif
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13817
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13818
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13819
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13820
	     */
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13821
	    if (lastGcData == gcData) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13822
		HRGN region = CreateRectRgn(cX, cY, cX + cW, cY + cH);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13823
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13824
		if (region == NULL ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 13825
		    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
 13826
		    FLUSH_CACHED_DC(gcData);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13827
		} else {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13828
		    if (SelectClipRgn(gcData->_hDC, region) == ERROR ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 13829
			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
 13830
			FLUSH_CACHED_DC(gcData);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13831
		    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13832
		    _DeleteObject(region, __LINE__);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13833
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13834
	    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13835
#endif
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13836
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13837
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13838
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13839
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13840
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13841
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13842
setDashes:dashList dashOffset:offset in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13843
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13844
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13845
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13846
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13847
    if (__isExternalAddress(aGCId)) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13848
	PRINTF(("WinWorkstat [warning]: dashes not (yet) implemented\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13849
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13850
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13851
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13852
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13853
setFont:aFontId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13854
    "set font to be drawn in"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13855
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13856
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13857
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13858
    if (__isExternalAddress(aGCId)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13859
     && __isExternalAddress(aFontId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13860
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13861
	struct gcData *gcData = _GCDATA(aGCId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13862
	HGDIOBJ prevFont, hFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13863
	TEXTMETRIC tmet;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13864
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13865
	hFont = _HGDIOBJVal(aFontId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13866
	if (gcData->hFont != hFont) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13867
	    gcData->hFont = hFont;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13868
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13869
#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
 13870
	    if (__tmpDC_hfont != hFont) {
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13871
		prevFont = SelectObject(__tmpDC, hFont);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13872
		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
 13873
		    __tmpDC_prev_hfont = prevFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13874
		}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13875
		__tmpDC_hfont = hFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13876
	    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13877
#else
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13878
	    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
 13879
#endif
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13880
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13881
	    GetTextMetrics(__tmpDC, &tmet);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13882
	    gcData->fontAscent = tmet.tmAscent;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13883
#ifdef SUPERDEBUG
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13884
	    if (__debug__) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13885
		char buf[80];
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13886
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13887
		GetTextFace(__tmpDC, 80, buf);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13888
		PRINTF(("setFont: %x %s\n", hFont, buf));
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13889
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13890
#endif
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13891
#ifndef CACHE_LAST_TMP_FONT
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13892
	    SelectObject(__tmpDC, prevFont);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13893
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13894
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13895
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13896
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13897
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13898
	     */
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13899
	    if (lastGcData == gcData) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13900
		prevFont = SelectObject(gcData->_hDC, hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13901
		if (! gcData->save_hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13902
		    gcData->save_hFont = prevFont;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13903
		}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13904
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13905
#endif
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13906
	    RETURN ( self );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13907
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13908
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13909
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13910
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13911
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13912
setForeground:fgColorIndex background:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13913
    "set foreground and background colors to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13914
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13915
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13916
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13917
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13918
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13919
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13920
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13921
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13922
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13923
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13924
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13925
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13926
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13927
	if ((fg != oldFg) || (bg != oldBg)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13928
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13929
	    gcData->bgColor = bg;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13930
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13931
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13932
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13933
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13934
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13935
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13936
		/* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13937
		if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13938
		    SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13939
		    FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13940
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13941
		if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13942
		    SetBkColor(gcData->_hDC, bg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13943
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13944
		FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13945
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13946
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13947
	    CPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13948
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13949
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13950
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13951
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13952
    ^self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13953
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13954
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13955
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13956
    "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
 13957
     solid (if aBitmapId is nil)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13958
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13959
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13960
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13961
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13962
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13963
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13964
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13965
	HBITMAP m, oldM;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13966
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13967
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13968
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13969
	if (__isExternalAddress(aBitmapId))
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13970
	    m = _HBITMAPVAL(aBitmapId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13971
	else
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13972
	    m = 0;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13973
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13974
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13975
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13976
	oldM = gcData->hMask;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13977
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13978
	if ((oldFg != fg) || (oldBg != bg) || (oldM != m)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13979
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13980
	    gcData->bgColor = bg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13981
	    gcData->hMask = m;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13982
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13983
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13984
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13985
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13986
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13987
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13988
		if (oldM == m) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13989
		    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13990
		     * only fg/bg changed
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13991
		     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13992
		    /* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13993
		    if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13994
			SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13995
			FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13996
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13997
		    if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13998
			SetBkColor(gcData->_hDC, bg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13999
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14000
		    FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14001
		} else {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14002
		    _releaseDC(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14003
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14004
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14005
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14006
	    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
 14007
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14008
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14009
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14010
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14011
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14012
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14013
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14014
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14015
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
 14016
    "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
 14017
     solid (if aBitmapId is nil); also set lineWidth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14018
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14019
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14020
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14021
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14022
	&& __isSmallInteger(aLineWidth)
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14023
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14024
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14025
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14026
	HBITMAP m, oldM;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14027
	int lw, oldLw;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14028
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14029
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14030
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14031
	if (__isExternalAddress(aBitmapId))
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14032
	    m = _HBITMAPVAL(aBitmapId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14033
	else
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14034
	    m = 0;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14035
	lw = __intVal(aLineWidth);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14036
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14037
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14038
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14039
	oldLw = gcData->lineWidth;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14040
	oldM = gcData->hMask;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14041
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14042
	if ((oldFg != fg) || (oldBg != bg)
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14043
	 || (oldLw != lw) || (oldM != m)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14044
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14045
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14046
	    gcData->bgColor = bg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14047
	    gcData->lineWidth = lw;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14048
	    gcData->hMask = m;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14049
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14050
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14051
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14052
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14053
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14054
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14055
		if ((oldM == m) && (oldLw == lw)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14056
		    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14057
		     * only fg/bg changed
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14058
		     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14059
		    /* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14060
		    if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14061
			SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14062
			FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14063
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14064
		    if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14065
			SetBkColor(gcData->_hDC, bg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14066
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14067
		    FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14068
		} else {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14069
		    _releaseDC(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14070
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14071
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14072
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14073
	    CPRINTF(("setForeground: %x background: %x mask: %x linewidth: %d\n",
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14074
			gcData->fgColor, gcData->bgColor,
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14075
			gcData->hMask, gcData->lineWidth));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14076
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14077
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14078
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14079
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14080
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14081
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14082
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14083
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14084
setForeground:fgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14085
    "set foreground color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14086
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14087
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14088
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14089
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14090
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14091
    if (__isSmallInteger(fgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14092
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14093
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14094
	COLORREF fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14095
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14096
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14097
	if (fg != gcData->fgColor) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14098
	    gcData->fgColor = fg;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14099
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14100
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14101
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14102
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14103
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14104
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14105
		/* Pen depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14106
		SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14107
		FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14108
		FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14109
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14110
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14111
	    CPRINTF(("setForeground: %x\n", gcData->fgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14112
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14113
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14114
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14115
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14116
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14117
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14118
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14119
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14120
setFunction:aFunctionSymbol in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14121
    "set alu function to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14122
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14123
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14124
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14125
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14126
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14127
	int fun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14128
	int bfun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14129
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14130
	if (aFunctionSymbol == @symbol(copy)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14131
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14132
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14133
	} else if (aFunctionSymbol == @symbol(copyInverted)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14134
	    fun = R2_NOTCOPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14135
	    bfun = BITBLT_COPYINVERTED;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14136
	} else if (aFunctionSymbol == @symbol(xor)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14137
	    fun = R2_XORPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14138
	    bfun = BITBLT_XOR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14139
	} else if (aFunctionSymbol == @symbol(and)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14140
	    fun = R2_MASKPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14141
	    bfun = BITBLT_AND;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14142
	} else if (aFunctionSymbol == @symbol(or)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14143
	    fun = R2_MERGEPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14144
	    bfun = BITBLT_OR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14145
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14146
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14147
	if (fun != -1) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14148
#if 0
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14149
	    console_printf("set func to");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14150
	    switch (bfun) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14151
		case BITBLT_COPY:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14152
		    console_printf("BITBLT_COPY\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14153
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14154
		case BITBLT_COPYINVERTED:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14155
		    console_printf("BITBLT_COPYINVERTED\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14156
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14157
		case BITBLT_XOR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14158
		    console_printf("BITBLT_XOR\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14159
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14160
		case BITBLT_AND:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14161
		    console_printf("BITBLT_AND\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14162
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14163
		case BITBLT_OR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14164
		    console_printf("BITBLT_OR\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14165
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14166
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14167
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14168
	} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14169
	    INFOFPRINTF( (stderr, "WinWorkstat [warning]: unsuported Rasterfunction\n") );
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14170
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14171
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14172
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14173
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14174
	if ((fun != gcData->rop2)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14175
	 || (bfun != gcData->bitbltrop2)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14176
	    gcData->rop2 = fun;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14177
	    gcData->bitbltrop2 = bfun;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14178
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14179
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14180
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14181
	     */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14182
	    if (gcData == lastGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14183
		SetROP2(gcData->_hDC, fun);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14184
	    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14185
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14186
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14187
    } else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14188
	INFOFPRINTF((stderr, "WinWorkstation [warning]: Rasterfunction no GC\n"));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14189
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14190
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14191
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14192
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14193
setGraphicsExposures:aBoolean in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14194
    "set or clear the graphics exposures flag"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14195
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14196
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14197
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14198
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14199
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14200
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14201
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14202
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14203
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14204
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14205
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14206
     && __isSmallInteger(aNumber)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14207
	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
 14208
	int style;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14209
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14210
	gcData->lineWidth = __intVal(aNumber);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14211
	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
 14212
	    style = PS_SOLID;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14213
	} 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
 14214
	    style= PS_DASH;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14215
	} 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
 14216
	    style= PS_DOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14217
	} 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
 14218
	    style= PS_DASHDOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14219
	} 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
 14220
	    style= PS_DASHDOTDOT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14221
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14222
	    style= PS_SOLID;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14223
	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
 14224
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14225
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14226
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14227
	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
 14228
	    style = PS_ENDCAP_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14229
	} 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
 14230
	    style = PS_ENDCAP_SQUARE;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14231
	} 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
 14232
	    style = PS_ENDCAP_FLAT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14233
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14234
	    style = PS_ENDCAP_FLAT;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14235
	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
 14236
	gcData->lStyle |= style;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14237
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14238
	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
 14239
	    style = PS_JOIN_BEVEL;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14240
	} 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
 14241
	    style = PS_JOIN_MITER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14242
	} 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
 14243
	    style = PS_JOIN_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14244
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14245
	    style = PS_JOIN_MITER;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14246
	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
 14247
	gcData->lStyle |= style;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14248
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14249
	FLUSH_CACHED_DC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14250
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14251
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14252
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14253
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14254
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14255
setMaskOriginX:orgX y:orgY in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14256
    "set the mask origin"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14257
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14258
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14259
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14260
    if (__isExternalAddress(aGCId)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14261
     && __bothSmallInteger(orgX,orgY)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14262
	struct gcData *gcData = _GCDATA(aGCId);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14263
	int oX, oY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14264
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14265
	oX = __intVal(orgX);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14266
	oY = __intVal(orgY);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14267
	if ((oX != gcData->maskOrgX)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14268
	 || (oY != gcData->maskOrgY)) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14269
	    gcData->maskOrgX = __intVal(orgX);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14270
	    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
 14271
	    FLUSH_CACHED_DC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14272
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14273
	RETURN (self);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14274
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14275
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14276
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14277
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14278
setPixmapMask:aPixmapId in:aGCId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14279
    "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
 14280
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14281
%{  /* NOCONTEXT */
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14282
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14283
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14284
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14285
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14286
	oldM = gcData->hMask;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14287
	if (__isExternalAddress(aPixmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14288
	    gcData->hMask = _HBITMAPVAL(aPixmapId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14289
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14290
	    gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14291
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14292
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14293
	    FLUSH_CACHED_DC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14294
	    DPRINTF(("PixmapMasks set to %x\n",gcData->hMask));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14295
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14296
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14297
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14298
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14299
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14300
5671
e8f727199c80 category of:12 methods
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
 14301
!WinWorkstation methodsFor:'initialization & release'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14302
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14303
closeConnection
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14304
    "close down the connection to the display"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14305
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14306
"/    Processor disableSemaphore:eventSema
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14307
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14308
3832
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 14309
initializeDefaultKeyboardMappingsIn:aKeyboardMap
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14310
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14311
    #(
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14312
	Copy            Ctrlc           "copy selection to buffer"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14313
	Cut             Ctrlx           "cut selection into buffer"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14314
	Paste           Ctrlv           "paste buffer or external selection"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14315
	UserAbort       CtrlCancel      "Abort window process"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14316
	UserInterrupt   Pause           "interrupt window process"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14317
	$0              KeyPad0         "NumLocked numeric keypad keys..."
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14318
	$1              KeyPad1
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14319
	$2              KeyPad2
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14320
	$3              KeyPad3
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14321
	$4              KeyPad4
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14322
	$5              KeyPad5
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14323
	$6              KeyPad6
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14324
	$7              KeyPad7
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14325
	$8              KeyPad8
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14326
	$9              KeyPad9
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14327
    ) pairWiseDo:[:eachMapping :eachKey|
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14328
	    aKeyboardMap
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14329
		bindValue:eachMapping to:eachKey.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14330
	].
5108
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14331
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14332
    "
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14333
     Screen default initializeDefaultKeyboardMappingsIn:Screen default keyboardMap
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14334
    "
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 14335
!
3832
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 14336
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14337
initializeDefaultValues
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14338
    focusMode := #activeWindow.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14339
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14340
"/    self activateOnClick:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14341
"/    self ignoreButtonPressOnActivate:false.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14342
"/    self rightButtonIsLowerWindow:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14343
"/    self shiftedLeftButtonIsLowerWindow:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14344
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14345
    buttonTranslation := ButtonTranslation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14346
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14347
    self initializeModifierMappings
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14348
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14349
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14350
initializeDevice
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14351
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14352
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14353
    int scr;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14354
    int maxRGBDepth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14355
    int rgbRedMask, rgbGreenMask, rgbBlueMask;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14356
    int nvi, i;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14357
    char *type, *nm;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14358
    int dummy;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14359
    int mask, shift, nBits;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14360
    HDC _rootDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14361
    OBJ id;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14362
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14363
    if (firstInstance) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14364
	OSVERSIONINFO osvi;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14365
	WNDCLASS wc;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14366
	firstInstance = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14367
	DPRINTF(("first create - registerClass\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14368
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14369
	memset(&osvi, 0, sizeof(OSVERSIONINFO));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14370
	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14371
	GetVersionEx (&osvi);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14372
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14373
	switch (osvi.dwMajorVersion) {
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14374
	    default:            // default is the newest version we know about
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14375
		INFOFPRINTF( (stderr, "WinWorkstat [warning]: unknown/new display version %d:%d\n", osvi.dwMajorVersion, osvi.dwMinorVersion) );
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14376
	    case 6:
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14377
		// vista, win7
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14378
		__isWinXP = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14379
		__isWinVista = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14380
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14381
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14382
	    case 5:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14383
		// 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
 14384
		switch (osvi.dwMinorVersion) {
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14385
		    default:
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14386
		    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
 14387
		    case 1:         // windows xp
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14388
			__isWinXP = 1;
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14389
			break;
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14390
		    case 0:
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14391
			__isWin2k = 1;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14392
		}
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14393
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14394
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14395
	    // no longer supported
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14396
	    case 4:   // nt4.0
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14397
	    case 3:   // nt3.51
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14398
	    case 2:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14399
	    case 1:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14400
	    case 0:
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14401
		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
 14402
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14403
	}
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14404
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14405
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14406
	 * register class: ST/X
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14407
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14408
	wc.style = 0
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14409
		   /* | CS_OWNDC */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14410
		   /* | CS_HREDRAW */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14411
		   /* | CS_VREDRAW */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14412
		  | CS_DBLCLKS;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14413
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14414
	wc.cbClsExtra = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14415
	wc.cbWndExtra = N_WINDOW_PRIVATE;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14416
	wc.hInstance = (HANDLE) __getHInstance();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14417
	wc.hIcon = NULL;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14418
	wc.hCursor = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14419
	wc.hbrBackground = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14420
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14421
	wc.lpszMenuName =  NULL;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14422
	wc.lpszClassName = wapp_name;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14423
	if (! RegisterClassW(&wc)) {
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14424
	    DPRINTF(("RegisterClassW failed\n"));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14425
	}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14426
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14427
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14428
	 * register class: ST/X:Root
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14429
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14430
	wc.style = 0;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14431
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14432
	wc.cbClsExtra = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14433
	wc.cbWndExtra = N_WINDOW_PRIVATE;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14434
	wc.hInstance = (HANDLE) __getHInstance();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14435
	wc.hIcon = NULL;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14436
	wc.hCursor = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14437
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14438
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14439
	wc.lpszMenuName =  NULL;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14440
	wc.lpszClassName = wapp_nameRoot;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14441
	if (! RegisterClassW(&wc)) {
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14442
	    DPRINTF(("RegisterClassW failed\n"));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14443
	}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14444
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14445
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14446
	 * register class: ST/X:Popup
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14447
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14448
	wc.style = CS_SAVEBITS;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14449
	if (__isWinXP) {
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14450
#ifndef CS_DROPSHADOW
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14451
# define CS_DROPSHADOW    0x020000
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14452
#endif
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14453
	    wc.style |= CS_DROPSHADOW;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14454
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14455
	wc.lpfnWndProc = (WNDPROC) MainWndProc;;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14456
	wc.cbClsExtra = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14457
	wc.cbWndExtra = N_WINDOW_PRIVATE;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14458
	wc.hInstance = (HANDLE) __getHInstance();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14459
	wc.hIcon = NULL;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14460
	wc.hCursor = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14461
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14462
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14463
	wc.lpszMenuName =  NULL;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14464
	wc.lpszClassName = wapp_namePopup;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14465
	if (! RegisterClassW(&wc)) {
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14466
	    DPRINTF(("RegisterClassW failed\n"));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14467
	}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14468
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14469
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14470
	 * register class: ST/X:Dialog
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14471
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14472
	wc.style = CS_SAVEBITS;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14473
	wc.lpfnWndProc = (WNDPROC) MainWndProc;;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14474
	wc.cbClsExtra = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14475
	wc.cbWndExtra = N_WINDOW_PRIVATE;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14476
	wc.hInstance = (HANDLE) __getHInstance();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14477
	wc.hIcon = NULL;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14478
	wc.hCursor = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14479
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14480
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14481
	wc.lpszMenuName =  NULL;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14482
	wc.lpszClassName = wapp_nameDialog;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14483
	if (! RegisterClassW(&wc)) {
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14484
	    DPRINTF(("RegisterClassW failed\n"));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14485
	}
5072
fcd3884582e0 unicode stuff
Claus Gittinger <cg@exept.de>
parents: 5067
diff changeset
 14486
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14487
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14488
	 * generate my events
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14489
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14490
	hDispatchThreadRunningEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14491
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14492
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14493
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14494
				"DispatchThreadRunning"); /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14495
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14496
	if (hDispatchThreadRunningEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14497
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-0 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14498
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14499
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14500
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14501
	hNeverTriggered = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14502
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14503
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14504
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14505
				"Never");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14506
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14507
	if (hNeverTriggered == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14508
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-1 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14509
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14510
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14511
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14512
	hCreateEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14513
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14514
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14515
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14516
				"CreateEvents"); /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14517
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14518
	if (hCreateEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14519
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-2 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14520
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14521
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14522
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14523
	hInputEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14524
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14525
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14526
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14527
				"InputEvents");  /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14528
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14529
	if (hInputEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14530
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-3 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14531
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14532
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14533
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14534
	if (hEventsMutex) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14535
	    console_fprintf(stderr, "WinWorkstation [fatal]: hEventsMutex already created\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14536
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14537
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14538
	hEventsMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14539
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14540
				FALSE,           /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14541
				"EventsMutex");  /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14542
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14543
	if (! hEventsMutex) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14544
	    console_fprintf(stderr, "WinWorkstation [fatal]: hEventsMutex failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14545
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14546
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14547
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14548
			hEventsMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14549
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14550
			&hEventsMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14551
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14552
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14553
			DUPLICATE_SAME_ACCESS);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14554
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 14555
#ifdef USE_PAINT_MUTEX
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14556
	hPaintMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14557
				NULL,           /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14558
				FALSE,          /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14559
				"PaintMutex");  /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14560
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14561
	if (hPaintMutex == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14562
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateMutex(PaintMutex) failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14563
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14564
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14565
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14566
			hPaintMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14567
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14568
			&hPaintMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14569
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14570
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14571
			DUPLICATE_SAME_ACCESS);
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 14572
#endif
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 14573
#ifdef USE_DRAW_MUTEX
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14574
	hDrawMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14575
				NULL,           /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14576
				FALSE,          /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14577
				"DrawMutex");   /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14578
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14579
	if (hDrawMutex == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14580
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateMutex(DrawMutex) failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14581
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14582
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14583
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14584
			hDrawMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14585
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14586
			&hDrawMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14587
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14588
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14589
			DUPLICATE_SAME_ACCESS);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14590
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14591
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14592
	_masterThreadId = GetCurrentThreadId();
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
 14593
#ifndef WIN32THREADS
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14594
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14595
			GetCurrentThread(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14596
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14597
			&_masterThread,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14598
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14599
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14600
			DUPLICATE_SAME_ACCESS);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14601
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14602
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14603
	initEventqueue();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14604
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14605
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14606
	 * start the event dispatcher thread and wait for it to
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14607
	 * be ready
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14608
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14609
	CreateThread((LPSECURITY_ATTRIBUTES)0,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14610
		     EVENT_THREAD_STACKSIZE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14611
		     (LPTHREAD_START_ROUTINE)dispatchThread,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14612
		     0, 0, &_dispatchThreadId);
4713
199dbf1a1406 changed #initializeDevice - call CreateThread instead of beginthreadNT
Stefan Vogel <sv@exept.de>
parents: 4712
diff changeset
 14613
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 14614
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14615
	console_fprintf(stderr, "WinWorkstation [info]: dispatchThreadId=%x\n", _dispatchThreadId);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14616
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14617
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14618
	if (WaitForSingleObject(hDispatchThreadRunningEvent, 5000L) != WAIT_OBJECT_0) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14619
	    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
 14620
	}
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 14621
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14622
	console_fprintf(stderr, "WinWorkstation [info]: got ThreadRunningEvent\n");
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 14623
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14624
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 14625
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14626
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14627
    __rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14628
    if (!__rootDesk) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14629
	PRINTF(("OpenDesktop fail\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14630
	__rootDesk = CreateDesktop ("Desktop0", NULL, NULL, 0, DESKTOP_WRITEOBJECTS, NULL);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14631
	if (!__rootDesk) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14632
	    PRINTF(("CreateDesktop fail\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14633
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14634
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14635
#endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14636
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14637
    __rootWin = GetDesktopWindow();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14638
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14639
    id = __MKOBJ(__rootWin);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14640
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14641
    __INST(rootWin) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14642
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14643
    _rootDC = __rootDC = CreateDC("DISPLAY", NULL, NULL, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14644
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14645
    __tmpDC = CreateCompatibleDC(_rootDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14646
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14647
    __nullPen = GetStockObject(NULL_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14648
    __blackPen = GetStockObject(BLACK_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14649
    __whitePen = GetStockObject(WHITE_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14650
    __blackBrush = GetStockObject(BLACK_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14651
    __whiteBrush = GetStockObject(WHITE_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14652
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14653
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14654
    id = __MKOBJ(_rootDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14655
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14656
    __INST(rootDC) = id; __STORE(self, id);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14657
%}.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14658
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14659
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14660
initializeEventBuffer
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14661
    |sz|
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14662
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14663
%{
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14664
    sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14665
%}.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14666
    eventBuffer isNil ifTrue:[
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14667
	eventBuffer := ByteArray new:sz.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14668
    ].
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14669
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14670
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14671
initializeFor:aDisplayName
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14672
    "initialize the receiver for a connection to the display;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14673
     the argument, aDisplayName is ignored under Win32.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14674
     (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
 14675
      windows displays ...)"
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14676
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14677
    displayId notNil ifTrue:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 14678
	"/ already connected - trying to trick me ?
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 14679
	^ self
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14680
    ].
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14681
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14682
    displayId := self primInitializeFor:aDisplayName.
3632
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 14683
    displayId isNil ifTrue:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 14684
	self class deviceOpenErrorSignal raiseWith:aDisplayName
3632
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 14685
    ].
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14686
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14687
    dispatching := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14688
    isSlow := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14689
    shiftDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14690
    ctrlDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14691
    metaDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14692
    altDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14693
    motionEventCompression := true.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14694
    buttonsPressed := 0.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14695
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14696
    self initializeScreenProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14697
    self initializeDevice.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14698
    self initializeVariableScreenProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14699
    self initializeVariableSettingsProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14700
    self initializeDeviceResourceTables.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14701
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14702
    self initializeDefaultValues.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14703
    self initializeEventBuffer.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14704
    self initializeSpecialFlags.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14705
    self initializeKeyboardMap.
5708
549499c89f59 delay the stylesheet reading till later
Claus Gittinger <cg@exept.de>
parents: 5672
diff changeset
 14706
    "/ 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
 14707
    "/ self initializeViewStyle.
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14708
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14709
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14710
initializeModifierMappings
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14711
    shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14712
    ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl').
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
 14713
    metaModifiers := #(#'Alt_L' #'Alt' #'Menu').
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14714
    altModifiers := #(#'Alt_R').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14715
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14716
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 14717
initializeSpecialFlags
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 14718
    "perform additional special server implementation flags"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 14719
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 14720
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14721
initializeVariableScreenProperties
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 14722
    "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
 14723
     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
 14724
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14725
%{
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14726
    int nvi, i, val, capabilities, planes, numcolors, numpens;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14727
    RECT rect;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14728
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14729
    GetWindowRect(__rootWin, &rect);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14730
    __INST(width) = __MKSMALLINT(rect.right - rect.left);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14731
    __INST(height) = __MKSMALLINT(rect.bottom - rect.top);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14732
    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
 14733
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14734
    __realDepth = GetDeviceCaps(__rootDC, BITSPIXEL);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14735
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14736
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14737
    __depth = 24;  /* its a hack */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14738
#else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14739
    __depth = __realDepth;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14740
    if (__depth == 15)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14741
	__depth = 16;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14742
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14743
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14744
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14745
    numcolors = GetDeviceCaps(__rootDC, NUMCOLORS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14746
    numpens = GetDeviceCaps(__rootDC, NUMPENS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14747
    planes = GetDeviceCaps(__rootDC, PLANES);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14748
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14749
    DPRINTF(("screen has %d planes\n", planes));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14750
    DPRINTF(("numcolors is %d\n", numcolors));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14751
    DPRINTF(("numpens is %d\n", numpens));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14752
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14753
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14754
    __INST(depth) = __MKSMALLINT(__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14755
    __INST(ncells) = __MKSMALLINT(1<<__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14756
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14757
    val = GetDeviceCaps(__rootDC, HORZSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14758
    DPRINTF(("HORSIZE=%d\n",val));
4386
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14759
    if (val > 0) {
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14760
	__INST(widthMM) = __MKSMALLINT(val);
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14761
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14762
    val = GetDeviceCaps(__rootDC, VERTSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14763
    DPRINTF(("VERTSIZE=%d\n",val));
4386
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14764
    if (val > 0) {
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14765
	__INST(heightMM) = __MKSMALLINT(val);
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14766
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14767
    __logPixelSY = GetDeviceCaps(__rootDC, LOGPIXELSY);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14768
    capabilities = GetDeviceCaps(__rootDC, RASTERCAPS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14769
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14770
#ifdef LATER
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14771
    console_printf("device support:\n");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14772
    if (capabilities & RC_BANDING)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14773
	console_printf(" RC_BANDING");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14774
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14775
    if (capabilities & RC_BITBLT)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14776
	console_printf(" RC_BITBLT");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14777
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14778
    if (capabilities & RC_BITMAP64)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14779
	console_printf(" RC_BITMAP64");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14780
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14781
    if (capabilities & RC_DI_BITMAP)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14782
	console_printf(" RC_DI_BITMAP");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14783
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14784
    if (capabilities & RC_DIBTODEV)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14785
	console_printf(" RC_DIBTODEV");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14786
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14787
    if (capabilities & RC_FLOODFILL)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14788
	console_printf(" RC_FLOODFILL");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14789
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14790
    if (capabilities & RC_PALETTE)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14791
	console_printf(" RC_PALETTE");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14792
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14793
    if (capabilities & RC_SCALING)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14794
	console_printf(" RC_SCALING");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14795
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14796
    if (capabilities & RC_STRETCHBLT)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14797
	console_printf(" RC_STRETCHBLT");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14798
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14799
    if (capabilities & RC_STRETCHDIB)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14800
	console_printf(" RC_STRETCHDIB");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14801
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14802
    console_printf("\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14803
    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
 14804
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14805
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14806
    __INST(whitepixel) = __MKSMALLINT(WhitePixel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14807
    __INST(blackpixel) = __MKSMALLINT(BlackPixel);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14808
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14809
    __INST(monitorType) = @symbol(unknown);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14810
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14811
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14812
    __INST(hasColors) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14813
    __INST(hasGreyscales) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14814
    __INST(visualType) = @symbol(TrueColor);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14815
    __INST(redShift) = __MKSMALLINT(0);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14816
    __INST(greenShift) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14817
    __INST(blueShift) = __MKSMALLINT(16);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14818
    switch (__realDepth) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14819
	case 15:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14820
	case 16:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14821
	    __INST(bitsPerRGB) = __MKSMALLINT(5);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14822
	    break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14823
	default:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14824
	    __INST(bitsPerRGB) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14825
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14826
    __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14827
    __INST(redMask) = __MKSMALLINT(0xFF);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14828
    __INST(greenMask) = __MKSMALLINT(0xFF00);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14829
    __INST(blueMask) = __MKSMALLINT(0xFF0000);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14830
#else
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14831
    if (! (capabilities & RC_PALETTE)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14832
	DPRINTF(("no palette\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14833
	if (__depth == 1) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14834
	    __INST(hasColors) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14835
	    __INST(hasGreyscales) = false;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14836
	    __INST(visualType) = @symbol(GrayScale);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14837
	    __INST(monitorType) = @symbol(monochrome);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14838
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14839
	    __INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14840
	    __INST(hasGreyscales) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14841
	    if ((__depth == 16) || (__depth == 15)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14842
	      __INST(visualType) = @symbol(TrueColor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14843
	      __INST(blueShift) = __MKSMALLINT(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14844
	      __INST(greenShift) = __MKSMALLINT(5);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14845
	      __INST(redShift) = __MKSMALLINT(11);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14846
	      __INST(bitsPerRGB) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14847
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14848
	      __INST(blueMask) = __MKSMALLINT(0x1f);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14849
	      __INST(greenMask) = __MKSMALLINT(0x7e0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14850
	      __INST(redMask) = __MKSMALLINT(0xf800);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14851
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14852
	      __INST(visualType) = @symbol(TrueColor);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14853
	      __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14854
	      __INST(greenShift) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14855
	      __INST(blueShift) = __MKSMALLINT(16);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14856
	      __INST(bitsPerRGB) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14857
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14858
	      __INST(redMask) = __MKSMALLINT(0xFF);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14859
	      __INST(greenMask) = __MKSMALLINT(0xFF00);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14860
	      __INST(blueMask) = __MKSMALLINT(0xFF0000);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14861
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14862
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14863
    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14864
	val = GetDeviceCaps(__rootDC, SIZEPALETTE); /* First two entries are black and white. */
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14865
	// console_printf("SizeofPalette %d\n",val);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14866
	__INST(ncells) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14867
	__INST(blackpixel) = __MKSMALLINT(0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14868
	__INST(whitepixel) = __MKSMALLINT(1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14869
	__INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14870
	__INST(hasGreyscales) = true;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14871
	// __INST(usingSystemPalette) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14872
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14873
	__INST(redShift) = __MKSMALLINT(0);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14874
	__INST(greenShift) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14875
	__INST(blueShift) = __MKSMALLINT(4);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14876
	__INST(bitsPerRGB) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14877
	__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14878
	__INST(redMask) = __MKSMALLINT(0x3);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14879
	__INST(greenMask) = __MKSMALLINT(0xc);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14880
	__INST(blueMask) = __MKSMALLINT(0x30);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14881
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14882
#endif /* ! ALWAYSTRUECOLOR */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14883
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14884
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14885
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14886
initializeVariableSettingsProperties
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14887
    "fetch properties which can be changed via the user settings.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14888
     Invoked initially and as a result of the settingsChange event."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14889
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14890
%{
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14891
    UINT multiClickTime;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14892
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14893
    multiClickTime = GetDoubleClickTime();
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14894
    DPRINTF(("multiClickTime = %d\n", multiClickTime));
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14895
    __INST(multiClickTimeDelta) = __MKSMALLINT(multiClickTime);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14896
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14897
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14898
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14899
primInitializeFor:aDisplayName
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14900
    "initialize the receiver for a connection to a display;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14901
     the argument, aDisplayName may be nil (for the default display)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14902
     or the name of the display server as hostname:number
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14903
     (not yet under WIN32)"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14904
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14905
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14906
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14907
    RETURN ( __MKSMALLINT(1) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14908
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14909
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14910
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14911
reinitialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14912
    rootWin := rootDC := nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14913
    super reinitialize.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14914
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14915
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14916
!WinWorkstation methodsFor:'keyboard mapping'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14917
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14918
altModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14919
    "return the mask (in motionEvents) for the alt-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14920
     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
 14921
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14922
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14923
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14924
    RETURN (__MKSMALLINT(AltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14925
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14926
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14927
    "Created: 23.3.1996 / 12:43:22 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14928
    "Modified: 23.3.1996 / 12:44:56 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14929
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14930
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14931
leftAltMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14932
    "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
 14933
     See comment in altModifierMask: / metaModifierMask: for what
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14934
     this could be used."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14935
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14936
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14937
    RETURN (__MKSMALLINT(LeftAltMask));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14938
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14939
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14940
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14941
metaModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14942
    "return the mask (in motionEvents) for the meta-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14943
     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
 14944
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14945
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14946
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14947
    RETURN (__MKSMALLINT(MetaMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14948
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14949
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14950
    "Created: 23.3.1996 / 12:43:39 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14951
    "Modified: 23.3.1996 / 12:45:09 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14952
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14953
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14954
modifierMapping
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14955
    "Get the Modifier Mapping.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14956
     We return an array of arrays of keycodes"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14957
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14958
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14959
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14960
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14961
rightAltMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14962
    "return the mask bit for the right Alt modifier key.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14963
     See comment in altModifierMask: / metaModifierMask: for what
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14964
     this could be used."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14965
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14966
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14967
    RETURN (__MKSMALLINT(RightAltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14968
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14969
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14970
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14971
stringFromKeycode:code
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14972
    "Get a KeySymbol (a smalltalk symbol) from the keycode."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14973
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14974
    ^ ''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14975
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14976
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14977
	Display stringFromKeycode:28
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14978
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14979
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14980
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14981
!WinWorkstation methodsFor:'misc'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14982
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14983
beep
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14984
    "output an audible beep"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14985
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 14986
    self beep:#iconExclamation volume:100.
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14987
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14988
    "
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14989
      Display beep
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14990
    "
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14991
!
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14992
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 14993
beep:aSymbolOrInteger volume:volumeInPercent
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 14994
    "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
 14995
     Volume is ignored here (kept for compatibility with XWorkstation"
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14996
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14997
    UserPreferences current beepEnabled ifFalse:[^ self].
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14998
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14999
%{
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15000
    unsigned int type;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15001
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15002
    if (__isSmallInteger(aSymbolOrInteger)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15003
	type = __smallIntegerVal(aSymbolOrInteger);
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15004
    } else if (aSymbolOrInteger == @symbol(iconAsterisk)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15005
	type = MB_ICONASTERISK;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15006
    } else if (aSymbolOrInteger == @symbol(iconExclamation)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15007
	type = MB_ICONEXCLAMATION;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15008
    } else if (aSymbolOrInteger == @symbol(iconHand)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15009
	type = MB_ICONHAND;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15010
    } else if (aSymbolOrInteger == @symbol(iconQuestion)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15011
	type = MB_ICONQUESTION;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15012
    } else if (aSymbolOrInteger == @symbol(ok)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15013
	type = MB_OK;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15014
    } else {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15015
	type = 0xffffffff;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15016
    }
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15017
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15018
#ifdef BEEP_IN_WINTHREAD
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15019
    PostThreadMessage(_dispatchThreadId, WM_THREAD_BEEP, 0, 0);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15020
#else
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15021
    MessageBeep(type);
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15022
#endif
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15023
%}
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15024
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15025
    "
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15026
      Display beep:#iconExclamation volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15027
      Display beep:#iconAsterisk volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15028
      Display beep:#iconQuestion volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15029
      Display beep:#iconHand volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15030
      Display beep:#ok volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15031
      Display beep:nil volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15032
      Display beep:0 volume:100
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15033
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15034
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15035
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15036
canEndSession:aBoolean
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15037
    "if set to false, Windows is not allowed to finish this session.
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15038
     The default is true."
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15039
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15040
    CanEndSession := aBoolean.
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15041
!
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15042
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15043
flush
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15044
    "send all buffered drawing to the display.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15045
     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
 15046
     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
 15047
     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
 15048
     (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
 15049
     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
 15050
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15051
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15052
     GdiFlush();
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15053
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15054
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15055
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15056
monitorHandleForPoint:aPoint
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15057
    "given a point, return a handle to the monitor"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15058
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15059
    |pX pY|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15060
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15061
    pX := aPoint x.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15062
    pY := aPoint y.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15063
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15064
    if (__bothSmallInteger(pX, pY)) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15065
	POINT p;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15066
	HMONITOR hMonitor;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15067
	p.x = __intVal(pX);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15068
	p.y = __intVal(pY);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15069
#if 0
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15070
	/* the following is only needed when we want
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15071
	 * to support very old NT/W95/W98 systems; we don't !
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15072
	 */
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15073
	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
 15074
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15075
	if (P_MonitorFromPoint == 0) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15076
	    HINSTANCE hUser = LoadLibrary("user32.dll");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15077
	    // 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
 15078
	    if (hUser) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15079
		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
 15080
				    GetProcAddress(hUser, "MonitorFromPoint");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15081
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15082
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15083
	// 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
 15084
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15085
	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
 15086
#else
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15087
	hMonitor = MonitorFromPoint(p, MONITOR_DEFAULTTONULL);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15088
#endif
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15089
	if (hMonitor == 0) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15090
	    RETURN(nil);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15091
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15092
	RETURN ( __MKEXTERNALADDRESS(hMonitor) );
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15093
    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15094
%}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15095
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15096
     Screen current monitorHandleForPoint:(0@0)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15097
     Screen current monitorHandleForPoint:(1500@0)
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15098
     Screen current monitorHandleForPoint:(3000@0)
5549
fd4fc69df52d fixed: #monitorHandleForPoint:
Claus Gittinger <cg@exept.de>
parents: 5546
diff changeset
 15099
     Screen current monitorHandleForPoint:(Display pointFromUser)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15100
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15101
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15102
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15103
monitorHandleForView:aWindowId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15104
    "given a window ID, return a handle to the monitor"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15105
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15106
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15107
    if (__isExternalAddress(aWindowId)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15108
	HWND hWnd = _HWNDVal(aWindowId);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15109
	HMONITOR hMonitor;
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15110
#if 0
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15111
	/* the following is only needed when we want
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15112
	 * to support very old NT/W95/W98 systems; we don't !
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15113
	 */
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15114
	static HMONITOR (__stdcall *P_MonitorFromWindow)(HWND, int);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15115
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15116
	if (P_MonitorFromWindow == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15117
	    HINSTANCE hUser = LoadLibrary("user32.dll");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15118
	    // console_printf("hUser: %x\n", hUser);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15119
	    if (hUser) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15120
		P_MonitorFromWindow = (HMONITOR (__stdcall *)(HWND, int ))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15121
				    GetProcAddress(hUser, "MonitorFromWindow");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15122
	    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15123
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15124
	// console_printf("P_MonitorFromWindow: %x\n", P_MonitorFromWindow);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15125
	hMonitor = (*P_MonitorFromWindow)(hWnd, MONITOR_DEFAULTTONULL);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15126
#else
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15127
	hMonitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONULL);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15128
#endif
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15129
	if (hMonitor == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15130
	    RETURN(nil);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15131
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15132
	RETURN ( __MKEXTERNALADDRESS(hMonitor) );
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15133
    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15134
%}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15135
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15136
     Screen current monitorHandleForView:(Transcript topView id)
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15137
     Screen current monitorHandleForPoint:(0@0)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15138
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15139
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15140
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15141
monitorHandles
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15142
    "retrieve a list of monitor handles"
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15143
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15144
    |handleArray|
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15145
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15146
    handleArray := Array new:(self numberOfMonitors).
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15147
%{
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15148
    struct EnumDisplayMonitorsProcData data;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15149
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15150
    data.hArray = handleArray;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15151
    data.index = 0;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15152
    EnumDisplayMonitors(NULL, NULL, EnumDisplayMonitorsProc, (long)(&data));
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15153
%}.
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15154
    ^ 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
 15155
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
 15156
    "
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
 15157
     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
 15158
    "
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
 15159
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
 15160
    "Modified (comment): / 28-01-2012 / 10:26:55 / cg"
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15161
!
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15162
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15163
setInputFocusTo:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15164
    self setInputFocusTo:aWindowId revertTo:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15165
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15166
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15167
setInputFocusTo:aWindowId revertTo:revertSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15168
    "set the focus to the view as defined by aWindowId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15169
     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
 15170
     input until a new focus is set.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15171
     RevertSymbol specifies what should happen if the view becomes invisible;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15172
     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
 15173
     given to the parent view, the root view or no view."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15174
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15175
%{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15176
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15177
	HWND hWnd = _HWNDVal(aWindowId);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 15178
	int r = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15179
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15180
	if (revertSymbol == @symbol(parent)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15181
	    r = 1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15182
	} else if (revertSymbol == @symbol(root)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15183
	    r = 2;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15184
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15185
	if (hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15186
	    if (GetFocus() != hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15187
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15188
#ifdef SET_FOCUS_IN_WINTHREAD
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15189
		PostMessage(hWnd, WM_THREAD_SETFOCUS, (INT)hWnd, GetCurrentThreadId());
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15190
#else
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15191
		if (SetFocus(hWnd) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15192
		    PRINTF(("SetFocus to %x failed.\n",hWnd));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15193
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15194
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15195
	    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15196
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 15197
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15198
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15199
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15200
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15201
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15202
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15203
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15204
!WinWorkstation methodsFor:'native dialogs'!
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15205
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15206
nativeConfirm:aString title:titleString flags:flags initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15207
     ^ self
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15208
	    nativeMessageBoxFor:nil
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15209
	    text:aString asString string
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15210
	    title:titleString
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15211
	    flags:flags
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15212
	    blocking:false
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15213
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15214
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15215
      Screen current
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15216
	nativeConfirm:'please confirm'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15217
	title:'Confirm'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15218
	flags:#( APPLMODAL ICONQUESTION OKCANCEL)
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15219
	initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15220
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15221
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15222
      Screen current
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15223
	nativeConfirm:'Yes or No'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15224
	title:'Confirm'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15225
	flags:#( APPLMODAL ICONQUESTION YESNO)
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15226
	initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15227
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15228
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15229
    "Modified: / 02-03-2007 / 15:37:57 / cg"
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15230
    "Modified: / 24-08-2010 / 16:17:29 / sr"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15231
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15232
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15233
nativeConfirmOKCancel:aString title:titleString initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15234
     ^ (self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15235
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15236
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15237
	    flags:#( APPLMODAL ICONQUESTION OKCANCEL)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15238
	    initialAnswer:trueOrFalse) == #IDOK
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15239
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15240
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15241
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15242
	nativeConfirmOKCancel:'please confirm' title:'Confirm' initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15243
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15244
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15245
    "Modified: / 02-03-2007 / 15:37:32 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15246
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15247
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15248
nativeConfirmYesNo:aString title:titleString initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15249
     ^ (self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15250
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15251
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15252
	    flags:#( APPLMODAL ICONQUESTION YESNO)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15253
	    initialAnswer:trueOrFalse) == #IDYES
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15254
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15255
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15256
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15257
	nativeConfirmYesNo:'please confirm' title:'Confirm' initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15258
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15259
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15260
    "Modified: / 02-03-2007 / 15:12:49 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15261
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15262
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15263
nativeFileDialogFor:ownerId save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15264
	     initialAnswer:initialOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15265
	     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
 15266
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15267
    "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
 15268
     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
 15269
     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
 15270
     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
 15271
     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
 15272
     filterArrayOrNil: if non nil, must be an array of 2-element arrays,
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15273
		       each element specifying filter commnet and filter
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15274
		       i.e. #( 'bitmap files (*.bmp)' '*.bmp' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15275
		       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
 15276
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15277
     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
 15278
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15279
    |flags|
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15280
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15281
    isSaveDialog ifTrue:[
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15282
	flags := #(
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15283
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15284
			#HIDEREADONLY
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15285
			#EXPLORER
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15286
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15287
			#OVERWRITEPROMPT
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15288
			#NOCHANGEDIR
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15289
		  )
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15290
    ] ifFalse:[
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15291
	flags := #(
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15292
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15293
			#HIDEREADONLY
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15294
			#EXPLORER
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15295
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15296
			#NOCHANGEDIR
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15297
		  )
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15298
    ].
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15299
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15300
    ^ self
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15301
	nativeFileDialogFor:ownerId
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15302
	save:isSaveDialog
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15303
	title:titleOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15304
	inDirectory:dirPathOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15305
	initialAnswer:initialOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15306
	flags:flags
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15307
	filter:filterArrayOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15308
	extension:extensionOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15309
	blocking:false
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15310
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15311
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15312
     Display
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15313
	nativeFileDialogFor:nil save:false
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15314
	title:'Test OpenFile Dialog'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15315
	inDirectory:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15316
	initialAnswer:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15317
	filter:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15318
	extension:nil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15319
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15320
     Display
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15321
	nativeFileDialogFor:nil save:true
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15322
	title:'Test SaveFile Dialog'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15323
	inDirectory:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15324
	initialAnswer:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15325
	filter:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15326
	extension:nil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15327
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15328
     Display
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15329
	nativeFileDialogFor:nil save:true
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15330
	title:'Test SaveFile Dialog'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15331
	inDirectory:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15332
	initialAnswer:'newFile.bmp'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15333
	filter:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15334
	extension:'bmp'
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15335
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15336
     Display
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15337
	nativeFileDialogFor:nil save:false
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15338
	title:'Test OpenFile Dialog'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15339
	inDirectory:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15340
	initialAnswer:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15341
	filter:#(
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15342
		    #( 'all files'       '*.*' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15343
		    #( 'smalltalk files' '*.st' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15344
		    #( 'change files'    '*.chg' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15345
		    #( 'image files'     '*.img' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15346
		)
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15347
	extension:nil
5641
b03c7d938fca changed: #nativeFileDialogFor:save:title:inDirectory:initialAnswer:filter:extension:
Claus Gittinger <cg@exept.de>
parents: 5640
diff changeset
 15348
    "
b03c7d938fca changed: #nativeFileDialogFor:save:title:inDirectory:initialAnswer:filter:extension:
Claus Gittinger <cg@exept.de>
parents: 5640
diff changeset
 15349
b03c7d938fca changed: #nativeFileDialogFor:save:title:inDirectory:initialAnswer:filter:extension:
Claus Gittinger <cg@exept.de>
parents: 5640
diff changeset
 15350
    "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
 15351
!
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15352
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15353
nativeFileDialogFor:ownerId save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15354
	     initialAnswer:initialOrNil flags:flagArray
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15355
	     filter:filterArrayOrNil extension:extensionOrNil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15356
	     blocking:blocking
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15357
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15358
    "start a native open-file dialog.
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15359
     If not cancelled, the selected fileName is returned; nil otherwise.
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15360
     Of course, this one looks like the
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15361
     Windows file dialog - no matter which viewStyle settings are active.
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15362
     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
 15363
     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
 15364
		       each element specifying filter commnet and filter
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15365
		       i.e. #( 'bitmap files (*.bmp)' '*.bmp' )
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15366
		       i.e. #( 'smalltalk files' '*.st' )
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15367
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15368
     EXPERIMENTAL & non-portable: use with caution"
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15369
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15370
    |rslt errorCode fileName|
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15371
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15372
%{  /* STACK: 32000*/
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15373
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15374
#ifndef NO_NATIVE_DIALOGS
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15375
    OPENFILENAME ofn;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15376
    HWND hWndOwner = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15377
    char fileNameBuffer[256] = "\0";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15378
    char filterBuffer[1024*4] = "\0";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15379
    BOOL __rslt;
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15380
    jmp_buf exitJmpBuf;
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15381
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15382
    if (__isExternalAddress(ownerId)) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15383
	hWndOwner = _HWNDVal(ownerId);
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15384
    }
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15385
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15386
# ifdef OPENFILENAME_SIZE_VERSION_400
3526
e9c3f08c2305 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
 15387
    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
 15388
# else
3544
6c59714157cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
 15389
    ofn.lStructSize = sizeof(ofn);
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15390
# endif
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15391
    ofn.hwndOwner = hWndOwner;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15392
    ofn.hInstance = NULL;
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15393
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15394
    if ((filterArrayOrNil != nil) && __isArrayLike(filterArrayOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15395
	char *dst = filterBuffer;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 15396
	unsigned int idx;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15397
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15398
	for (idx=0; idx<__arraySize(filterArrayOrNil); idx++) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15399
	    OBJ el = __ArrayInstPtr(filterArrayOrNil)->a_element[idx];
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15400
// console_printf("idx = %d\n", idx);
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15401
	    if (__isArrayLike(el) && (__arraySize(el) == 2)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15402
		OBJ descr, filter;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15403
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15404
		descr = __ArrayInstPtr(el)->a_element[0];
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15405
		filter = __ArrayInstPtr(el)->a_element[1];
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15406
		if (__isStringLike(descr) && __isStringLike(filter)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15407
		    char *src = __stringVal(descr);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15408
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15409
// 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
 15410
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15411
		    // append (incl 0-byte)
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15412
		    while (*src) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15413
			*dst++ = *src++;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15414
		    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15415
		    *dst++ = '\0';
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15416
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15417
		    src = __stringVal(filter);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15418
		    // append (incl 0-byte)
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15419
		    while (*src) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15420
			*dst++ = *src++;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15421
		    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15422
		    *dst++ = '\0';
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15423
		}
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15424
	    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15425
	}
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15426
	*dst++ = '\0';
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15427
	*dst = '\0';
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15428
	ofn.lpstrFilter = filterBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15429
	ofn.nFilterIndex = 1;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15430
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15431
	ofn.lpstrFilter = NULL;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15432
	ofn.nFilterIndex = 0;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15433
    }
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15434
    ofn.lpstrCustomFilter = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15435
    ofn.nMaxCustFilter = 0;
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15436
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15437
    if (__isStringLike(initialOrNil)) {
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15438
	strcpy(fileNameBuffer, __stringVal(initialOrNil));
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15439
    }
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15440
    ofn.lpstrFile = fileNameBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15441
    ofn.nMaxFile = sizeof(fileNameBuffer);
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15442
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15443
    ofn.lpstrFileTitle = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15444
    ofn.nMaxFileTitle = 0;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15445
    if (__isStringLike(dirPathOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15446
	ofn.lpstrInitialDir = __stringVal(dirPathOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15447
    } else {
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15448
	ofn.lpstrInitialDir = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15449
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15450
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15451
    if (__isStringLike(titleOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15452
	ofn.lpstrTitle = __stringVal(titleOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15453
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15454
	ofn.lpstrTitle = "";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15455
    }
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15456
    ofn.nFileOffset = 0;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15457
    ofn.nFileExtension = 0;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15458
    if (__isStringLike(extensionOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15459
	ofn.lpstrDefExt = __stringVal(extensionOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15460
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15461
	ofn.lpstrDefExt = NULL;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15462
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15463
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15464
    ofn.lCustData = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15465
    ofn.lpfnHook = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15466
    ofn.lpTemplateName = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15467
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15468
    ofn.Flags = 0;
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15469
    if (__isNonNilObject(flagArray) && __isArrayLike(flagArray)) {
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 15470
	unsigned int i;
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15471
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15472
	for (i=0; i<__arraySize(flagArray); i++) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15473
	    OBJ flag = __ArrayInstPtr(flagArray)->a_element[i];
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15474
	    int flagVal = 0;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15475
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15476
	    if (__isSmallInteger(flag)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15477
		flagVal = __intVal(flag);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15478
	    } else if (flag == @symbol(READONLY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15479
		flagVal = OFN_READONLY;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15480
	    } else if (flag == @symbol(OVERWRITEPROMPT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15481
		flagVal = OFN_OVERWRITEPROMPT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15482
	    } else if (flag == @symbol(HIDEREADONLY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15483
		flagVal = OFN_HIDEREADONLY;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15484
	    } else if (flag == @symbol(NOCHANGEDIR)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15485
		flagVal = OFN_NOCHANGEDIR;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15486
	    } else if (flag == @symbol(SHOWHELP)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15487
		flagVal = OFN_SHOWHELP;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15488
	    } else if (flag == @symbol(ENABLEHOOK)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15489
		flagVal = OFN_ENABLEHOOK;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15490
	    } else if (flag == @symbol(ENABLETEMPLATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15491
		flagVal = OFN_ENABLETEMPLATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15492
	    } else if (flag == @symbol(ENABLETEMPLATEHANDLE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15493
		flagVal = OFN_ENABLETEMPLATEHANDLE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15494
	    } else if (flag == @symbol(NOVALIDATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15495
		flagVal = OFN_NOVALIDATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15496
	    } else if (flag == @symbol(ALLOWMULTISELECT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15497
		flagVal = OFN_ALLOWMULTISELECT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15498
	    } else if (flag == @symbol(EXTENSIONDIFFERENT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15499
		flagVal = OFN_EXTENSIONDIFFERENT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15500
	    } else if (flag == @symbol(PATHMUSTEXIST)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15501
		flagVal = OFN_PATHMUSTEXIST;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15502
	    } else if (flag == @symbol(FILEMUSTEXIST)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15503
		flagVal = OFN_FILEMUSTEXIST;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15504
	    } else if (flag == @symbol(CREATEPROMPT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15505
		flagVal = OFN_CREATEPROMPT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15506
	    } else if (flag == @symbol(SHAREAWARE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15507
		flagVal = OFN_SHAREAWARE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15508
	    } else if (flag == @symbol(NOREADONLYRETURN)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15509
		flagVal = OFN_NOREADONLYRETURN;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15510
	    } else if (flag == @symbol(NOTESTFILECREATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15511
		flagVal = OFN_NOTESTFILECREATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15512
	    } else if (flag == @symbol(NONETWORKBUTTON)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15513
		flagVal = OFN_NONETWORKBUTTON;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15514
	    } else if (flag == @symbol(NOLONGNAMES)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15515
		flagVal = OFN_NOLONGNAMES;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15516
# ifdef OFN_EXPLORER
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15517
	    } else if (flag == @symbol(EXPLORER)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15518
		flagVal = OFN_EXPLORER;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15519
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15520
# ifdef OFN_NODEREFERENCELINKS
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15521
	    } else if (flag == @symbol(NODEREFERENCELINKS)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15522
		flagVal = OFN_NODEREFERENCELINKS;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15523
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15524
# ifdef OFN_LONGNAMES
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15525
	    } else if (flag == @symbol(LONGNAMES)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15526
		flagVal = OFN_LONGNAMES;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15527
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15528
# ifdef OFN_ENABLEINCLUDENOTIFY
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15529
	    } else if (flag == @symbol(ENABLEINCLUDENOTIFY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15530
		flagVal = OFN_ENABLEINCLUDENOTIFY;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15531
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15532
# ifdef OFN_ENABLESIZING
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15533
	    } else if (flag == @symbol(ENABLESIZING)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15534
		flagVal = OFN_ENABLESIZING;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15535
# endif
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15536
	    }
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15537
	    ofn.Flags |= flagVal;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15538
	}
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15539
    }
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15540
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15541
    if (isSaveDialog == true) {
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15542
	if (blocking == true) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15543
	    __rslt = GetSaveFileName(&ofn);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15544
	} else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15545
	    do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15546
		__threadErrno = 0;
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15547
		__rslt = __STX_API_CALL1( "GetSaveFileName", (void *)GetSaveFileName, (void *)(&ofn));
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15548
	    } while ((__rslt < 0) && (__threadErrno == EINTR));
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15549
	}
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15550
    } else {
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15551
	if (blocking == true) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15552
	    __rslt = GetOpenFileName(&ofn);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15553
	} else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15554
	    do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15555
		__threadErrno = 0;
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15556
		__rslt = __STX_API_CALL1( "GetOpenFileName", (void *)GetOpenFileName, (void *)(&ofn));
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15557
	    } while ((__rslt < 0) && (__threadErrno == EINTR));
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15558
	}
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15559
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15560
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15561
    if ( @global(WinWorkstation:VerboseNativeDialogs) == true) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15562
	console_fprintf(stderr, "WinWorkstation [info]: after GetOpenFileName\n");
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15563
    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15564
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15565
    if (setjmp(exitJmpBuf)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15566
	__setAtExitLongJmp(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15567
	if ( @global(WinWorkstation:VerboseNativeDialogs) == true) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15568
	    console_fprintf(stderr, "WinWorkstation [warning]: exit longjmp\n");
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15569
	}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15570
	rslt = false;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15571
	errorCode = __MKSMALLINT(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15572
	goto getOutOfHere;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15573
    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15574
    __setAtExitLongJmp(exitJmpBuf);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15575
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15576
    if (__rslt == TRUE) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15577
	rslt = true;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15578
	fileName = __MKSTRING(fileNameBuffer);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15579
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15580
	rslt = false;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15581
	errorCode = __MKSMALLINT(CommDlgExtendedError());
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15582
    }
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15583
    __setAtExitLongJmp(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15584
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15585
#else
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15586
    errorCode = __MKSMALLINT(-1);
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15587
#endif /* NO_NATIVE_DIALOGS */
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15588
getOutOfHere: ;
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15589
%}.
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15590
    (errorCode notNil) ifTrue:[
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 15591
	errorCode ~~ 0 ifTrue:[
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 15592
	    self primitiveFailed.
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 15593
	].
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 15594
	^ nil
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15595
    ].
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15596
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15597
    ^ fileName
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15598
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15599
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15600
     Display
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15601
	nativeFileDialogFor:nil save:false
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15602
	title:'Test OpenFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15603
	inDirectory:nil
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15604
	initialAnswer:nil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15605
	flags:#( ENABLESIZING HIDEREADONLY EXPLORER ENABLESIZING )
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15606
	filter:#(
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15607
		    #( 'all files'       '*.*' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15608
		    #( 'smalltalk files' '*.st' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15609
		    #( 'change files'    '*.chg' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15610
		    #( 'image files'     '*.img' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15611
		)
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15612
	extension:nil
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15613
	blocking:false
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15614
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15615
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15616
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15617
     Display
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15618
	nativeFileDialogFor:nil save:false
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15619
	title:'Test OpenFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15620
	inDirectory:nil
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15621
	initialAnswer:nil
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15622
	flags:#( ENABLESIZING HIDEREADONLY EXPLORER ENABLESIZING )
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15623
	filter:#(
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15624
		    #( 'all files'       '*.*' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15625
		    #( 'smalltalk files' '*.st' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15626
		    #( 'change files'    '*.chg' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15627
		    #( 'image files'     '*.img' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15628
		)
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15629
	extension:nil
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15630
	blocking:true
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15631
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15632
!
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15633
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15634
nativeGetDefaultPrinterDialog
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15635
    "start a native printer dialog.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15636
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15637
     EXPERIMENTAL & non-portable: use with caution"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15638
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15639
    |errorCode newDCHandle|
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15640
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15641
%{  /* STACK: 32000*/
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15642
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15643
#ifdef NO_NATIVE_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15644
# define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15645
#endif
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15646
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15647
#define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15648
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15649
#ifndef NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15650
    PRINTDLG pdsetup;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15651
    OBJ newGCHandle;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15652
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15653
    memset(&pdsetup, 0, sizeof(pdsetup));
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15654
    pdsetup.lStructSize = sizeof(pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15655
    pdsetup.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15656
    if (! PrintDlg(&pdsetup)) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15657
	RETURN (nil);
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15658
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15659
    if ( pdsetup.hDC ) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15660
	newDCHandle = __MKOBJ( pdsetup.hDC );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15661
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15662
#else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15663
    errorCode = __MKSMALLINT(-1);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15664
#endif /* NO_NATIVE_PRINT_DIALOGS */
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15665
%}.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15666
    (errorCode notNil) ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15667
	self primitiveFailed.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15668
	^ nil
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15669
    ].
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15670
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15671
    ^ newDCHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15672
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15673
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15674
     Display nativeGetDefaultPrinterDialog
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15675
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15676
!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15677
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15678
nativeGetPrinterDialogDefault:defaultBoolean
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15679
    "start a native printer dialog.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15680
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15681
     EXPERIMENTAL & non-portable: use with caution"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15682
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15683
    |errorCode newDCHandle|
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15684
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15685
%{  /* STACK: 32000*/
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15686
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15687
#ifdef NO_NATIVE_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15688
# define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15689
#endif
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15690
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15691
#define xxNO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15692
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15693
#ifndef NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15694
    PRINTDLG pdsetup;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15695
    OBJ newGCHandle;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15696
    int answer;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15697
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15698
    memset(&pdsetup, 0, sizeof(pdsetup));
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15699
    pdsetup.lStructSize = sizeof(pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15700
    pdsetup.Flags = PD_RETURNDC;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15701
    if (defaultBoolean == true) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15702
	pdsetup.Flags |= PD_RETURNDEFAULT;
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15703
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15704
# ifdef BLOCKING
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15705
    answer = PrintDlg(&pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15706
# else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15707
    answer = __STX_API_CALL1( "PrintDlg",
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15708
					(void *)PrintDlg,
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15709
					(void *)&pdsetup );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15710
# endif
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15711
    if (! answer) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15712
	RETURN (nil);
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15713
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15714
    if ( pdsetup.hDC ) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15715
	newDCHandle = __MKOBJ( pdsetup.hDC );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15716
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15717
#else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15718
    errorCode = __MKSMALLINT(-1);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15719
#endif /* NO_NATIVE_PRINT_DIALOGS */
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15720
%}.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15721
    (errorCode notNil) ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15722
	self primitiveFailed.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15723
	^ nil
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15724
    ].
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15725
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15726
    ^ newDCHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15727
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15728
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15729
     Display nativeGetPrinterDialogDefault:true
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15730
     Display nativeGetPrinterDialogDefault:false
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15731
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15732
!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15733
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15734
nativeInformationOK:aString title:titleString
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15735
     ^ self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15736
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15737
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15738
	    flags:#( APPLMODAL ICONINFORMATION OK)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15739
	    initialAnswer:nil
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15740
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15741
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15742
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15743
	nativeInformationOK:'Some Info' title:'Info'
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:40 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15747
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15748
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15749
nativeMessageBoxFor:ownerId text:textOrNil title:titleOrNil flags:flagArray blocking:blocking
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15750
    "start a native message box dialog.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15751
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15752
     EXPERIMENTAL & non-portable: use with caution"
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15753
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15754
    |errorCode answer|
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15755
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15756
%{  /* STACK: 32000*/
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15757
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15758
#ifndef NO_NATIVE_DIALOGS
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15759
    HWND hWndOwner = NULL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15760
    int boxFlags = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15761
    char *__title;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15762
    char *__text;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15763
    int __answer;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15764
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15765
    if (__isExternalAddress(ownerId)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15766
	hWndOwner = _HWNDVal(ownerId);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15767
    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15768
    if (__isStringLike(titleOrNil)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15769
	__title = __stringVal(titleOrNil);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15770
    } else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15771
	__title = "";
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15772
    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15773
    if (__isStringLike(textOrNil)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15774
	__text = __stringVal(textOrNil);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15775
    } else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15776
	__text = "";
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15777
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15778
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15779
    if (__isNonNilObject(flagArray) && __isArrayLike(flagArray)) {
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 15780
	unsigned int i;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15781
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15782
	for (i=0; i<__arraySize(flagArray); i++) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15783
	    OBJ flag = __ArrayInstPtr(flagArray)->a_element[i];
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15784
	    int flagVal = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15785
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15786
	    if (__isSmallInteger(flag)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15787
		flagVal = __intVal(flag);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15788
	    } else if (flag == @symbol(ABORTRETRYIGNORE)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15789
		flagVal = MB_ABORTRETRYIGNORE;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15790
	    } else if (flag == @symbol(APPLMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15791
		flagVal = MB_APPLMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15792
	    } else if (flag == @symbol(DEFAULT_DESKTOP_ONLY)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15793
		flagVal = MB_DEFAULT_DESKTOP_ONLY;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15794
	    } else if (flag == @symbol(DEFBUTTON1)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15795
		flagVal = MB_DEFBUTTON1;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15796
	    } else if (flag == @symbol(DEFBUTTON2)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15797
		flagVal = MB_DEFBUTTON2;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15798
	    } else if (flag == @symbol(DEFBUTTON3)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15799
		flagVal = MB_DEFBUTTON3;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15800
	    } else if (flag == @symbol(ICONASTERISK)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15801
		flagVal = MB_ICONASTERISK;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15802
	    } else if (flag == @symbol(ICONHAND)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15803
		flagVal = MB_ICONHAND;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15804
	    } else if (flag == @symbol(ICONINFORMATION)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15805
		flagVal = MB_ICONINFORMATION;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15806
	    } else if (flag == @symbol(ICONQUESTION)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15807
		flagVal = MB_ICONQUESTION;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15808
	    } else if (flag == @symbol(ICONSTOP)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15809
		flagVal = MB_ICONSTOP;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15810
	    } else if (flag == @symbol(OK)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15811
		flagVal = MB_OK;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15812
	    } else if (flag == @symbol(OKCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15813
		flagVal = MB_OKCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15814
	    } else if (flag == @symbol(RETRYCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15815
		flagVal = MB_RETRYCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15816
	    } else if (flag == @symbol(SETFOREGROUND)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15817
		flagVal = MB_SETFOREGROUND;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15818
	    } else if (flag == @symbol(SYSTEMMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15819
		flagVal = MB_SYSTEMMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15820
	    } else if (flag == @symbol(TASKMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15821
		flagVal = MB_TASKMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15822
	    } else if (flag == @symbol(YESNO)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15823
		flagVal = MB_YESNO;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15824
	    } else if (flag == @symbol(YESNOCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15825
		flagVal = MB_YESNOCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15826
	    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15827
	    boxFlags |= flagVal;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15828
	}
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15829
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15830
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15831
    if (blocking == true) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15832
	__answer = MessageBox(hWndOwner,
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15833
		   __text,
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15834
		   __title,
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15835
		   boxFlags);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15836
    } else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15837
	do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15838
	    __threadErrno = 0;
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15839
	    __answer = __STX_API_CALL4( "MessageBox",
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15840
					(void *)MessageBox,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15841
					(void *)hWndOwner,
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15842
					(void *)__text,
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15843
					(void *)__title,
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15844
					(void *)boxFlags);
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15845
	} while ((__answer < 0) && (__threadErrno == EINTR));
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15846
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15847
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15848
    switch (__answer) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15849
	case IDABORT:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15850
	    answer = @symbol(IDABORT);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15851
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15852
	case IDCANCEL:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15853
	    answer = @symbol(IDCANCEL);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15854
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15855
	case IDIGNORE:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15856
	    answer = @symbol(IDIGNORE);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15857
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15858
	case IDNO:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15859
	    answer = @symbol(IDNO);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15860
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15861
	case IDOK:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15862
	    answer = @symbol(IDOK);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15863
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15864
	case IDRETRY:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15865
	    answer = @symbol(IDRETRY);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15866
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15867
	case IDYES:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15868
	    answer = @symbol(IDYES);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15869
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15870
	default:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15871
	    answer = __MKSMALLINT(__answer);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15872
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15873
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15874
#else
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15875
    errorCode = __MKSMALLINT(-1);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15876
#endif /* NO_NATIVE_DIALOGS */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15877
%}.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15878
    (errorCode notNil) ifTrue:[
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15879
	self primitiveFailed.
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 15880
	^ nil
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15881
    ].
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15882
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15883
    ^ answer
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15884
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15885
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15886
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15887
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15888
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15889
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15890
	flags:#( OK APPLMODAL ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15891
	blocking:true
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15892
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15893
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15894
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15895
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15896
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15897
	flags:#( OK APPLMODAL ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15898
	blocking:false
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15899
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15900
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15901
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15902
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15903
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15904
	flags:#( ABORTRETRYIGNORE ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15905
	blocking:false
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15906
    "
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15907
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15908
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15909
nativeWarnOK:aString title:titleString
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15910
     ^ self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15911
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15912
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15913
	    flags:#( APPLMODAL ICONSTOP OK)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15914
	    initialAnswer:nil
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15915
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15916
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15917
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15918
	nativeWarnOK:'some warning' title:'Warning'
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15919
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15920
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15921
    "Modified: / 02-03-2007 / 15:37:47 / cg"
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15922
! !
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15923
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15924
!WinWorkstation methodsFor:'native widget support'!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15925
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15926
nativeDialogs
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15927
    ^ NativeDialogs ? false
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15928
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15929
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15930
nativeDialogs:aBoolean
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15931
    "enable / disable use of native dialogs.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15932
     This is an experimental, unfinished, unsupported feature.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15933
     For now, this only affects some file-, warning-, information and confirmation dialogs."
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15934
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15935
    NativeDialogs := aBoolean
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15936
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15937
    "
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 15938
     Screen current nativeDialogs:true
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 15939
     Screen current nativeDialogs:false
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15940
    "
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15941
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15942
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15943
nativeFileDialogs
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15944
    ^ NativeFileDialogs ? false
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15945
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15946
    "Created: / 24-08-2010 / 16:41:13 / sr"
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15947
!
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15948
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15949
nativeFileDialogs:aBoolean
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15950
    "enable / disable use of native file dialogs.
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15951
     This is an experimental, unfinished, unsupported feature.
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15952
     For now, this only affects some file dialogs."
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15953
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15954
    NativeFileDialogs := aBoolean
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15955
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15956
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15957
     Screen current nativeFileDialogs:true
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15958
     Screen current nativeFileDialogs:false
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15959
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15960
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15961
    "Created: / 24-08-2010 / 16:41:36 / sr"
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15962
!
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15963
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15964
nativeWidgets
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15965
    ^ NativeWidgets ? false
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15966
!
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15967
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15968
nativeWidgets:aBoolean
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15969
    "enable / disable use of native widgets.
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15970
     This is an experimental, unfinished, unsupported feature.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15971
     For now, this only affects some widgets."
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15972
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15973
    NativeWidgets := aBoolean
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15974
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15975
    "
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15976
     Screen current nativeWidgets:true
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15977
     Screen current nativeWidgets:false
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15978
    "
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15979
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15980
4263
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15981
supportsNativeDialogs
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15982
    ^ true
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15983
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15984
    "
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15985
     Screen current supportsNativeDialogs
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15986
    "
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15987
!
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15988
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15989
supportsNativeFileDialogs
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15990
    ^ true
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15991
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15992
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15993
     Screen current supportsNativeFileDialogs
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15994
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15995
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15996
    "Created: / 24-08-2010 / 16:28:42 / sr"
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15997
!
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15998
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15999
supportsNativeWidgets
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16000
    ^ true
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16001
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16002
    "
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16003
     Screen current supportsNativeWidgets
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16004
    "
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16005
! !
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16006
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16007
!WinWorkstation methodsFor:'pointer queries '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16008
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16009
anyButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16010
    "return an integer for masking out any button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16011
     buttonStates value."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16012
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16013
    "/ should use ``Display buttonXMotionMask bitOr:....''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16014
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16015
%{  /* NOCONTEXT */
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16016
    RETURN ( __MKSMALLINT(AnyButtonMask) );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16017
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16018
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16019
    "Modified: 23.3.1996 / 12:41:33 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16020
    "Created: 23.3.1996 / 12:46:35 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16021
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16022
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16023
buttonStates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16024
    "return an integer representing the state of the pointer buttons;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16025
     a one-bit in positions 0.. represent a pressed button.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16026
     See the button1Mask/button2Mask/button3Mask,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16027
     shiftMask/controlMask and modifierMask methods for the meaning of the bits."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16028
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16029
%{  /* NOCONTEXT */
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16030
    int modifiers = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16031
    int b1m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16032
    int b3m = Button3Mask;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16033
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16034
    if (GetSystemMetrics(SM_SWAPBUTTON)) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16035
	b3m = Button1Mask;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16036
	b1m = Button3Mask;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16037
    }
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16038
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16039
    if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16040
	modifiers |= b1m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16041
    if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16042
	modifiers |= Button2Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16043
    if (GetAsyncKeyState(VK_RBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16044
	modifiers |= b3m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16045
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16046
    RETURN (__MKSMALLINT(modifiers));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16047
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16048
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16049
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16050
     Display buttonStates
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16051
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16052
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16053
    "is the control-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16054
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16055
     Display buttonStates bitTest:(Display controlMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16056
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16057
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16058
    "is the alt/meta-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16059
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16060
     Display buttonStates bitTest:(Display altModifierMask)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16061
     Display buttonStates bitTest:(Display metaModifierMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16062
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16063
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16064
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16065
leftButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16066
    "return an integer for masking out the left button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16067
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16068
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16069
    "/ should use ``Display button1MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16070
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16071
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16072
    RETURN ( __MKSMALLINT(Button1Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16073
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16074
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16075
    "Modified: 23.3.1996 / 12:41:33 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16076
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16077
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16078
middleButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16079
    "return an integer for masking out the middle button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16080
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16081
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16082
    "/ should use ``Display button2MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16083
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16084
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16085
    RETURN ( __MKSMALLINT(Button2Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16086
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16087
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16088
    "Modified: 23.3.1996 / 12:41:43 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16089
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16090
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16091
pointerPosition
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
 16092
    "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
 16093
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16094
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16095
    POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16096
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16097
    if (! GetCursorPos(&p)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16098
	p.x = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16099
	p.y = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16100
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16101
    RETURN (__MKPOINT_INT(p.x, p.y));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16102
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16103
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16104
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16105
rightButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16106
    "return an integer for masking out the right button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16107
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16108
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16109
    "/ should use ``Display button3MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16110
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16111
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16112
    RETURN ( __MKSMALLINT(Button3Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16113
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16114
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16115
    "Modified: 23.3.1996 / 12:41:52 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16116
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16117
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16118
rootPositionOfLastEvent
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16119
    "return the position in root-window coordinates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16120
     of the last button, key or pointer event"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16121
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16122
%{  /* NOCONTEXT */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16123
    RETURN (__MKPOINT_INT(evRootX, evRootY));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16124
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16125
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16126
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16127
setPointerPosition:newPosition
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16128
    "change the pointer position in root-window coordinates."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16129
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16130
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16131
    if (__isPoint(newPosition)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16132
	OBJ xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16133
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16134
	xpos = __point_X(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16135
	ypos = __point_Y(newPosition);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16136
	if (__bothSmallInteger(xpos, ypos)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16137
	    SetCursorPos(__intVal(xpos), __intVal(ypos));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16138
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16139
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16140
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16141
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16142
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16143
setPointerPosition:newPosition in:aWindowId
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16144
    "change the pointer position to a new position relative to the
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16145
     given windows origin (which may be the rootWindow).
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16146
     Be careful with this - its usually not very ergonimically
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16147
     to change the mousePointer position.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16148
     This interface is provided for special applications (presentation
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16149
     playback) and should not be used in normal applications."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16150
3895
31caf29bcda1 there is no setCursorPosition (?!)
Claus Gittinger <cg@exept.de>
parents: 3850
diff changeset
 16151
"/    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
 16152
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16153
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16154
!WinWorkstation methodsFor:'private error handling'!
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16155
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16156
textOutFailed
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16157
    "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
 16158
     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
 16159
     GetLastError is 5"
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16160
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16161
    "/ self error:'textOut failed'.
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16162
! !
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16163
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16164
!WinWorkstation methodsFor:'retrieving pixels'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16165
1461
6d8b022bfcd8 renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
 16166
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
 16167
    "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
 16168
     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
 16169
     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
 16170
     number of bytes per scanline. The number of bytes per scanline is not known
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16171
     in advance, since the X-server is free to return whatever it thinks is a good padding."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16172
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16173
    |rawInfo info|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16174
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16175
    ((w <= 0) or:[h <= 0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16176
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16177
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16178
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16179
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16180
    rawInfo := Array new:11.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16181
		  "1 -> bit order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16182
		  "2 -> depth"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16183
		  "3 -> bytes_per_line"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16184
		  "4 -> byte_order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16185
		  "5 -> format"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16186
		  "6 -> bitmap_unit"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16187
		  "7 -> bitmap_pad"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16188
		  "8 -> bits_per_pixel"
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16189
		  "9 -> red_mask"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16190
		  "10 -> green_mask"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16191
		  "11 -> blue_mask"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16192
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16193
    "/ had to extract the getPixel call into a separate method, to specify
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16194
    "/ unlimitedStack (some implementations use alloca and require huge amounts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16195
    "/ of temporary stack space
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16196
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16197
    (self primGetBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:rawInfo) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16198
	info := IdentityDictionary new.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16199
	info at:#bitOrder put:(rawInfo at:1).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16200
	info at:#depth put:(rawInfo at:2).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16201
	info at:#bytesPerLine put:(rawInfo at:3).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16202
	info at:#byteOrder put:(rawInfo at:4).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16203
	info at:#format put:(rawInfo at:5).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16204
	info at:#bitmapUnit put:(rawInfo at:6).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16205
	info at:#bitmapPad put:(rawInfo at:7).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16206
	info at:#bitsPerPixel put:(rawInfo at:8).
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16207
	info at:#redMask put:(rawInfo at:9).
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16208
	info at:#greenMask put:(rawInfo at:10).
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16209
	info at:#blueMask put:(rawInfo at:11).
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16210
	^ info
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16211
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16212
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16213
     some error occured - either args are not smallintegers, imageBits is not a ByteArray
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16214
     or is too small to hold the bits
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16215
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16216
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16217
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16218
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16219
getBitsFromPixmapId:aDrawableId x:srcx y:srcy width:w height:h into:imageBits
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16220
    "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
 16221
     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
 16222
     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
 16223
     number of bytes per scanline. The number of bytes per scanline is not known
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16224
     in advance, since the X-server is free to return whatever it thinks is a good padding."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16225
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16226
    |rawInfo info|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16227
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16228
    ((w <= 0) or:[h <= 0]) ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16229
	self primitiveFailed.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16230
	^ nil
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16231
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16232
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16233
    rawInfo := Array new:11.
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16234
		  "1 -> bit order"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16235
		  "2 -> depth"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16236
		  "3 -> bytes_per_line"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16237
		  "4 -> byte_order"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16238
		  "5 -> format"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16239
		  "6 -> bitmap_unit"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16240
		  "7 -> bitmap_pad"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16241
		  "8 -> bits_per_pixel"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16242
		  "9 -> red_mask"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16243
		  "10 -> green_mask"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16244
		  "11 -> blue_mask"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16245
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16246
    "/ had to extract the getPixel call into a separate method, to specify
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16247
    "/ unlimitedStack (some implementations use alloca and require huge amounts
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16248
    "/ of temporary stack space
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16249
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16250
    (self primGetBitsFromPixmap:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:rawInfo) ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16251
	info := IdentityDictionary new.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16252
	info at:#bitOrder put:(rawInfo at:1).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16253
	info at:#depth put:(rawInfo at:2).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16254
	info at:#bytesPerLine put:(rawInfo at:3).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16255
	info at:#byteOrder put:(rawInfo at:4).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16256
	info at:#format put:(rawInfo at:5).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16257
	info at:#bitmapUnit put:(rawInfo at:6).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16258
	info at:#bitmapPad put:(rawInfo at:7).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16259
	info at:#bitsPerPixel put:(rawInfo at:8).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16260
	info at:#redMask put:(rawInfo at:9).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16261
	info at:#greenMask put:(rawInfo at:10).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16262
	info at:#blueMask put:(rawInfo at:11).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16263
	^ info
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16264
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16265
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16266
     some error occured - either args are not smallintegers, imageBits is not a ByteArray
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16267
     or is too small to hold the bits
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16268
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16269
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16270
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16271
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 16272
getPixelX:px y:py from:ignoredDrawableId with:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16273
    "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
 16274
     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
 16275
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16276
%{  /* NOCONTEXT */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16277
    if (__isExternalAddress(aGCId)
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16278
     && __bothSmallInteger(px, py)) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16279
	struct gcData *gcData = _GCDATA(aGCId);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16280
	HDC hDC;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16281
	int __x = __intVal(px), __y = __intVal(py);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16282
	int pixel;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16283
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16284
	hDC = _getDC(gcData);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16285
	pixel = GetPixel(hDC, __x, __y);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16286
#ifndef CACHE_LAST_DC
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16287
	_releaseDC(gcData);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16288
#endif
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16289
	/*
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 16290
	 * for compatibility, returns the pixelValue
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16291
	 * from a monochrome bitmap
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16292
	 */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16293
	if (gcData->hBitmap) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16294
	    if (gcData->bitmapColorBitCount == 1) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16295
		pixel = (pixel == 0) ? 0 : 1;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16296
	    }
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16297
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16298
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16299
	RETURN ( __MKSMALLINT(pixel & 0xFFFFFF) );
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16300
    }
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16301
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16302
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16303
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16304
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16305
primGetBitsFrom:aDrawableId x:srcX y:srcY width:w height:h into:imageBits infoInto:info
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 16306
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16307
%{
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16308
    int     height, width;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 16309
    unsigned int numBytes;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16310
    int     bytesPerRow;
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16311
    HWND    hWnd;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16312
    HBITMAP hBitmap = 0;
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16313
    HGDIOBJ hPrevious = 0;
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16314
    HDC     bDC = 0;
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16315
    struct {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 16316
	BITMAPINFOHEADER bmiHeader;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 16317
	DWORD r;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 16318
	DWORD g;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 16319
	DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16320
    } bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16321
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16322
    if (! __isExternalAddress(aDrawableId)) {
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16323
	INFOFPRINTF((stderr, "WinWorkstation [warning]: externalAddress arg\n"));
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16324
	goto fail;
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16325
    }
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16326
    if (! __bothSmallInteger(srcX, srcY)) {
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16327
	INFOFPRINTF((stderr, "WinWorkstation [warning]: x,y args\n"));
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16328
	goto fail;
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16329
    }
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16330
    if (! __bothSmallInteger(w, h)) {
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16331
	INFOFPRINTF((stderr, "WinWorkstation [warning]: w,h args\n"));
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16332
	goto fail;
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16333
    }
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16334
    if (! __isArray(info)) {
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16335
	INFOFPRINTF((stderr, "WinWorkstation [warning]: info arg\n"));
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16336
	goto fail;
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16337
    }
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16338
    if (! __isByteArray(imageBits)) {
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16339
	INFOFPRINTF((stderr, "WinWorkstation [warning]: info arg\n"));
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16340
	goto fail;
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16341
    }
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16342
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16343
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16344
	hWnd = _HWNDVal( aDrawableId );
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16345
	BMDPRINTF(("primGetBits %x\n",hWnd));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16346
	if( hWnd != 0 ) {
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16347
	    HDC wDC;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16348
	    HANDLE prevBitmap;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16349
	    int widthRoundedUpToNextMultipleOf4 = ((width + 3 ) / 4) * 4;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16350
	    int widthUsed;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16351
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16352
	    bDC = CreateCompatibleDC(__rootDC);
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16353
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16354
	    BMDPRINTF(("primGetBits srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h)));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16355
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16356
	    width  =  __intVal(w);
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16357
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16358
	    widthUsed = widthRoundedUpToNextMultipleOf4;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16359
	    widthUsed = width;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16360
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16361
	    BMDPRINTF(("width %d height %d\n",width,height));
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16362
	    hBitmap = CreateCompatibleBitmap(__rootDC, widthUsed, height);
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16363
	    if (!hBitmap) {
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16364
		INFOFPRINTF((stderr, "WinWorkstation [warning]: CreateCompatibleBitmap failed\n"));
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16365
		goto fail;
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16366
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16367
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16368
	    bitmap.bmiHeader.biPlanes = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16369
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16370
	    bitmap.bmiHeader.biCompression = BI_RGB;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16371
	    bytesPerRow = (((width*3) + 3 ) / 4) * 4;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16372
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16373
	    if (__depth == 24) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16374
		bitmap.bmiHeader.biCompression = BI_RGB;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16375
		bytesPerRow = (((width*3) + 3 ) / 4) * 4;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16376
	    } else if (__depth == 16) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16377
# if 0
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16378
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16379
		bitmap.b = 0x001f;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16380
		bitmap.g = 0x07e0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16381
		bitmap.r = 0xf800;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16382
		bytesPerRow = (((width*2) + 1 ) / 4) * 4;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16383
# else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16384
		bitmap.b = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16385
		bitmap.g = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16386
		bitmap.r = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16387
		bitmap.bmiHeader.biCompression = BI_RGB;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16388
		bytesPerRow = (((width*3) + 3 ) / 4) * 4;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16389
# endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16390
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16391
#endif /* ALWAYSTRUECOLOR */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16392
	    bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16393
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16394
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16395
	    bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16396
	    bitmap.bmiHeader.biClrImportant = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16397
	    bitmap.bmiHeader.biBitCount = __depth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16398
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16399
	    bitmap.bmiHeader.biWidth = widthUsed;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16400
	    bitmap.bmiHeader.biHeight = -height;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16401
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16402
	    wDC = GetDC(hWnd);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16403
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16404
	    hPrevious = SelectObject(bDC, hBitmap);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16405
	    if (BitBlt(bDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16406
		   0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16407
		   width,height,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16408
		   wDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16409
		   __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16410
		   SRCCOPY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16411
		 == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16412
		)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16413
	    {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16414
		INFOFPRINTF((stderr, "WinWorkstation [warning]: in primGetBitsFrom: BitBlt\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16415
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16416
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16417
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16418
	    if (lastGcData && (lastGcData->_hDC == wDC)) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
 16419
# ifdef DEBUG_DC_REUSE
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16420
		console_fprintf(stderr, "WinWorkstation [info]: Oops - dont release - cachedDC reuse\n", __LINE__);
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
 16421
# endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16422
	    } else
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16423
#endif
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16424
	    {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16425
#ifdef CACHE_LAST_WM_PAINT_DC
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16426
		if (last_wm_paint_dc && (last_wm_paint_dc == wDC)) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
 16427
# ifdef DEBUG_DC_REUSE
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16428
		    console_fprintf(stderr, "WinWorkstation [info]: Oops - dont release - last_wm_paint_dc reuse\n", __LINE__);
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
 16429
# endif
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16430
		} else
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16431
#endif
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16432
		{
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16433
		    ReleaseDC(hWnd, wDC);
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16434
		}
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16435
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16436
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 16437
	    if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16438
	    {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16439
		INFOFPRINTF((stderr, "WinWorkstation [warning]: noinfo returned in primGetBits\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16440
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16441
	    }
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16442
	    BMDPRINTF(("bitmap info:%d %d %d %d\n",
3553
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 16443
			bitmap.bmiHeader.biWidth, bitmap.bmiHeader.biHeight,
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 16444
			bitmap.bmiHeader.biBitCount, bitmap.bmiHeader.biSizeImage));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16445
	    numBytes = bitmap.bmiHeader.biSizeImage;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16446
	    if( numBytes != 0 ) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16447
		if (numBytes > __byteArraySize(imageBits)) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16448
		    /* imageBits too small */
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16449
		    INFOFPRINTF((stderr, "WinWorkstation [warning]: primGetBits - byteArray too small (is:%d need:%d; w:%d h:%d)\n",
3553
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 16450
				__byteArraySize(imageBits), numBytes,
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16451
				bitmap.bmiHeader.biWidth, -bitmap.bmiHeader.biHeight
3553
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 16452
			     ));
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16453
		    goto fail;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16454
		}
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16455
		BMDPRINTF(("numBytes %d\n",numBytes));
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16456
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16457
		bitmap.bmiHeader.biHeight = -height;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16458
		if (GetDIBits(bDC,hBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16459
		{
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16460
		    INFOFPRINTF((stderr, "WinWorkstation [warning]: zero bits returned in primGetBits\n"));
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16461
		    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16462
		}
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16463
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16464
		/* swap red and blue (windows delivers BGR) */
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16465
		{
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16466
		    char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16467
#ifdef PRE_18_FEB_05
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16468
		    int n = numBytes;
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16469
		    for ( ;n > 0; n -= 3, cp += 3) {
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16470
			  char b = cp[0];
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16471
			  cp[0] = cp[2];
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16472
			  cp[2] = b;
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16473
		    }
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16474
#else
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16475
		    int h;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16476
		    char *rowp = cp;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16477
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16478
		    for (h=height; h>0; h--) {
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16479
			int w;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16480
			char *pixel = rowp;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16481
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16482
			for (w=width; w>0; w--) {
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16483
			    char b;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16484
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16485
			    b = pixel[0];
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16486
			    pixel[0] = pixel[2];
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16487
			    pixel[2] = b;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16488
			    pixel += 3;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16489
			};
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16490
			rowp += bytesPerRow;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16491
		    };
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16492
#endif
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16493
		}
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16494
	    } else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16495
		INFOFPRINTF((stderr, "WinWorkstation [warning]: unacceptable bitmap in primGetBits\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16496
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16497
	    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16498
	} else {
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16499
	    INFOFPRINTF((stderr, "WinWorkstation [warning]: unacceptable HWND in primGetBits\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16500
	    goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16501
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16502
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16503
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);                                 // bitOrder
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16504
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);                                   // depth
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16505
	__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(bytesPerRow);                         // bytesPerLine
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16506
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);                                 // byteOrder
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16507
	__ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);                                 // format
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16508
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);                                   // bitmapUnit
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16509
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);                        // bitmapPad
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16510
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);         // bitsPerPixel
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16511
	__ArrayInstPtr(info)->a_element[8] = __MKSMALLINT(0x0000FF);   // redMask
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16512
	__ArrayInstPtr(info)->a_element[9] = __MKSMALLINT(0x00FF00);   // greenMask
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16513
	__ArrayInstPtr(info)->a_element[10] = __MKSMALLINT(0xFF0000);  // blueMask
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16514
	if ((hPrevious != NULL) && (bDC != NULL))
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16515
	    SelectObject(bDC, hPrevious);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16516
	if (bDC)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16517
	    DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16518
	if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 16519
	    _DeleteObject(hBitmap, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16520
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16521
    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16522
fail: ;
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16523
    if ((hPrevious != NULL) && (bDC != NULL))
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 16524
	SelectObject(bDC, hPrevious);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16525
    if (bDC)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16526
	DeleteDC(bDC);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16527
    if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 16528
	_DeleteObject(hBitmap, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16529
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16530
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16531
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16532
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16533
primGetBitsFromPixmap:aDrawableId x:srcX y:srcY width:w height:h into:imageBits infoInto:info
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16534
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16535
%{
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16536
    int            height, width;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 16537
    unsigned int   numBytes;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16538
    unsigned char* ep = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16539
    HBITMAP        xBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16540
    HBITMAP hBitmap = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16541
    HDC bDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16542
    HDC xDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16543
    struct
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16544
    {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16545
	BITMAPINFOHEADER bmiHeader;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16546
	DWORD rgb[2];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16547
    } bitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16548
    BITMAP bitmapInfo;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16549
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16550
    if (__isExternalAddress(aDrawableId)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16551
     && __bothSmallInteger(srcX, srcY)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16552
     && __bothSmallInteger(w, h)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16553
     && __isArray(info)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16554
     && __isByteArray(imageBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16555
    {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16556
	xBitmap = _HBITMAPVAL( aDrawableId );
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16557
	BMDPRINTF(("primGetBitsFromPixmap %x\n",xBitmap));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16558
	if (xBitmap != 0) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16559
	    xDC = GetDC(0);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16560
	    SelectObject(xDC, xBitmap);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16561
	    GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16562
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16563
	    bDC = CreateCompatibleDC(__rootDC);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16564
	    BMDPRINTF(("srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h)));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16565
	    height =  __intVal(h);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16566
	    width  =  __intVal(w);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16567
	    BMDPRINTF(("width %d height %d\n",width,height));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16568
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16569
	    hBitmap = CreateCompatibleBitmap(xDC, width, height);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16570
	    if (!hBitmap)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16571
		goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16572
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16573
	    SelectObject(bDC,hBitmap);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16574
	    if (BitBlt(bDC,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16575
		   0,0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16576
		   width,height,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16577
		   xDC,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16578
		   __intVal(srcX), __intVal(srcY),
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16579
		   SRCCOPY)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16580
		 == 0
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16581
		)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16582
	    {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16583
		 BMDPRINTF(("ERROR in primGetBitsFromPixmap: BitBlt\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16584
		 goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16585
	    }
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16586
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16587
	    bitmap.bmiHeader.biPlanes = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16588
#ifdef ALWAYSTRUECOLOR
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16589
	    bitmap.bmiHeader.biCompression = BI_RGB;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16590
#else
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16591
	    if (__depth == 24) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16592
		/*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16593
		bitmap.r = 0xff0000;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16594
		bitmap.g = 0x00ff00;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16595
		bitmap.b = 0x0000ff;*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16596
		bitmap.bmiHeader.biCompression = BI_RGB;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16597
	    } else if (__depth == 16) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16598
		/*bitmap.bmiHeader.biCompression = BI_RGB;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16599
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16600
		bitmap.b = 0x001f;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16601
		bitmap.g = 0x07e0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16602
		bitmap.r = 0xf800;*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16603
		bitmap.bmiHeader.biCompression = BI_RGB;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16604
	    } else {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16605
		BMDPRINTF(("primGetBitsFromPixmap: unsupported depth\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16606
		got fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16607
	    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16608
#endif /* ALWAYSTRUECOLOR */
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16609
	    bitmap.bmiHeader.biSizeImage = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16610
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16611
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16612
	    bitmap.bmiHeader.biClrUsed = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16613
	    bitmap.bmiHeader.biClrImportant = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16614
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16615
	    bitmap.bmiHeader.biWidth = width;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16616
	    bitmap.bmiHeader.biHeight = -height;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16617
	    bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16618
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16619
	    if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16620
	    {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16621
		BMDPRINTF(("noinfo returned\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16622
		goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16623
	    }
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16624
	    BMDPRINTF(("bitmap info:%d %d %d %d\n",bitmap.bmiHeader.biWidth,bitmap.bmiHeader.biHeight,bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biSizeImage));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16625
	    numBytes = bitmap.bmiHeader.biSizeImage;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16626
	    if ( numBytes != 0 ) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16627
		if (numBytes > __byteArraySize(imageBits)) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16628
		    /* imageBits too small */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16629
		    BMDPRINTF(("provided byteArray too small\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16630
		    goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16631
		}
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16632
		BMDPRINTF(("numBytes %d\n",numBytes));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16633
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16634
		bitmap.bmiHeader.biHeight = -height;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16635
		bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16636
		bitmap.rgb[0] = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16637
		bitmap.rgb[1] = 0xffffff;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16638
		if (GetDIBits(xDC,xBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16639
		{
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16640
		    BMDPRINTF(("zero bits returned\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16641
		    goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16642
		}
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16643
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16644
#if 0
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16645
		{
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16646
		    /* swap red and blue (windows delivers BGR) */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16647
		    char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16648
		    int n = numBytes;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16649
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16650
		    for ( ;n > 0; n -= 3, cp += 3) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16651
			  char b = cp[0];
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16652
			  cp[0] = cp[2];
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16653
			  cp[2] = b;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16654
		    }
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16655
		}
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16656
#endif
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16657
	    } else {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16658
		BMDPRINTF(("unacceptable bitmap\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16659
		goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16660
	    }
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16661
	} else {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16662
	    BMDPRINTF(("unacceptable bitmap\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16663
	    goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16664
	}
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16665
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16666
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16667
	__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(numBytes/height);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16668
	__ArrayInstPtr(info)->a_element[3] = @symbol(lsbFirst);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16669
	__ArrayInstPtr(info)->a_element[4] = (bitmap.bmiHeader.biBitCount == 1) ? @symbol(ZPixmap) : @symbol(XYPixmap);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16670
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16671
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16672
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16673
	__ArrayInstPtr(info)->a_element[8] = __MKSMALLINT(0xFF0000);   // redMask
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16674
	__ArrayInstPtr(info)->a_element[9] = __MKSMALLINT(0x00FF00);   // greenMask
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16675
	__ArrayInstPtr(info)->a_element[10] = __MKSMALLINT(0x0000FF);  // blueMask
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16676
	if (bDC)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16677
	    DeleteDC(bDC);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16678
	if (xDC)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16679
	    ReleaseDC(0, xDC); //DeleteDC(xDC);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16680
	if (hBitmap)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16681
	    DeleteObject(hBitmap);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16682
	RETURN ( true );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16683
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16684
fail:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16685
    if (bDC)
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16686
	DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16687
    if (xDC)
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16688
	ReleaseDC(0, xDC); //DeleteDC(xDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16689
    if (hBitmap)
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16690
	DeleteObject(hBitmap);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16691
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16692
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16693
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16694
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16695
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16696
!WinWorkstation methodsFor:'style defaults'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16697
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16698
defaultStyleValueFor:aKey
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16699
    "return a default style value, given a key.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16700
     These defaults are used if nothing is specified
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16701
     in the style sheet
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16702
     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
 16703
     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
 16704
     where the systemDefaults are used ..."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16705
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16706
    |clr|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16707
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16708
"/    aKey == #shadowColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16709
"/        ^ Color black
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16710
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16711
"/    aKey == #lightColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16712
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16713
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16714
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16715
    aKey == #viewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16716
	clr := self getSystemColor:#COLOR_WINDOW.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16717
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16718
    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16719
	clr := self getSystemColor:#COLOR_WINDOWTEXT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16720
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16721
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16722
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16723
"/    aKey == #scrollerViewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16724
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16725
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16726
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16727
"/    aKey == #textBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16728
"/        ^ Color white.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16729
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16730
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16731
    clr notNil ifTrue:[^ clr].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16732
    ^ super defaultStyleValueFor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16733
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16734
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16735
!WinWorkstation methodsFor:'tray access'!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16736
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16737
addTrayIconFor:aView
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16738
	icon:wicon iconMask:wiconMaskArg
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16739
	toolTipMessage:toolTipMessageArg
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16740
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16741
    "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
 16742
     The icon, mask and toolTopText are optional.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16743
     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
 16744
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16745
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16746
     wiconWidth wiconHeight toolTipMessage|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16747
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16748
    "/ 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
 16749
    toolTipMessageArg size > 63 ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16750
	toolTipMessage := toolTipMessageArg copyTo:63
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16751
    ] ifFalse:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16752
	toolTipMessage := toolTipMessageArg.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16753
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16754
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16755
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16756
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16757
    wicon notNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16758
	wiconId := (wicon asFormOn:self) id.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16759
	wiconHeight := wicon height.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16760
	wiconWidth  := wicon width.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16761
	wiconMask := wiconMaskArg.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16762
	wiconMask isNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16763
	    wiconMask := wicon mask.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16764
	].
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16765
	wiconMask notNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16766
	    "/ WIN32's mask has zeros for opaque pixels
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16767
	    invertedWiconMask := wiconMask copy.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16768
	    invertedWiconMask bits invert.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16769
	    invertedWiconMask := invertedWiconMask onDevice:self.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16770
	    wiconMaskId := invertedWiconMask id
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16771
	].
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16772
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16773
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16774
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16775
#ifndef WM_TRAY_MESSAGE
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16776
# define WM_TRAY_MESSAGE (WM_USER+0x200)
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16777
#endif
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16778
    HBITMAP        xBitMap, maskBitmap;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16779
    HICON          xIcon = (HICON)0;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16780
    ICONINFO       iconInfo;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16781
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16782
    unsigned char fastBits[10000];
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16783
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16784
    /* get bitmap for icon */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16785
    if ( __isExternalAddress(wiconId) ) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16786
	xBitMap = _HBITMAPVAL( wiconId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16787
	if ( xBitMap != 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16788
	    BITMAP bm;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16789
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16790
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16791
		int d = bm.bmPlanes * bm.bmBitsPixel;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16792
		BYTE *ep;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16793
		int height, width;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16794
		int nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16795
		unsigned char *allocatedBits = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16796
		int privateMask = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16797
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16798
		if ( __isExternalAddress(wiconMaskId) ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16799
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16800
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16801
		    if (wiconMaskId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16802
			PRINTF(("WinWorkstat [warning]: wiconMaskId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16803
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16804
		    maskBitmap = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16805
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16806
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16807
		/*
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16808
		 * if there is no mask, generate one
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16809
		 */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16810
		if (maskBitmap == 0) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16811
		    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
 16812
		    height = __intVal( wiconHeight );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16813
		    width  = __intVal( wiconWidth  );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16814
		    nBytes = ( width + 15 ) / 8;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16815
		    nBytes = height * nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16816
		    if (nBytes < sizeof(fastBits)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16817
			ep = fastBits;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16818
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16819
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16820
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16821
		    if ( ep == 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16822
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16823
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16824
			memset(ep, 0, nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16825
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16826
			if ( maskBitmap == NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16827
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16828
			} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16829
			    privateMask = 1;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16830
			}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16831
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16832
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16833
		if ( maskBitmap != NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16834
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16835
		    iconInfo.fIcon = TRUE;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16836
		    iconInfo.hbmMask  = maskBitmap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16837
		    iconInfo.hbmColor = xBitMap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16838
		    xIcon = CreateIconIndirect( &iconInfo );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16839
		    if (privateMask) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16840
			DeleteObject( maskBitmap );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16841
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16842
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16843
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16844
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16845
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16846
		if (allocatedBits) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16847
		    free(allocatedBits);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16848
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16849
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16850
	} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16851
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16852
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16853
    } else {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16854
	if (wiconId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16855
	    PRINTF(("WinWorkstat [warning]: wiconId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16856
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16857
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16858
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16859
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16860
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16861
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16862
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16863
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16864
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16865
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16866
	    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
 16867
			     // 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
 16868
	    nid.uFlags =
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16869
		NIF_ICON        //we're adding an icon
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16870
		| 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
 16871
		| NIF_TIP;      //our icon has a tooltip.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16872
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16873
	    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
 16874
	    if (xIcon) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16875
		nid.hIcon   = xIcon;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16876
		/* 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
 16877
	    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16878
		nid.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16879
	    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 16880
	    if (__isStringLike(toolTipMessage)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16881
		strcpy(nid.szTip, __stringVal(toolTipMessage));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16882
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16883
	    Shell_NotifyIcon(NIM_ADD, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16884
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16885
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16886
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16887
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16888
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16889
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16890
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16891
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16892
     v openAndWait.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16893
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16894
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16895
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16896
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16897
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16898
	  toolTipMessage:'Hi There'
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16899
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16900
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16901
    "Created: / 31-10-2007 / 01:51:49 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16902
    "Modified: / 05-11-2007 / 12:18:54 / cg"
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16903
!
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16904
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16905
removeTrayIconFor:aView
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16906
    "remove the tray icon"
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16907
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16908
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16909
     wiconWidth wiconHeight|
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16910
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16911
    windowId := aView id.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16912
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16913
%{  /* STACK: 20000 */
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16914
#ifndef WM_TRAY_MESSAGE
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16915
# define WM_TRAY_MESSAGE (WM_USER+0x200)
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16916
#endif
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16917
    NOTIFYICONDATA nid;
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16918
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16919
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16920
    nid.cbSize = sizeof(NOTIFYICONDATA);
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16921
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16922
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16923
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16924
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16925
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16926
	    nid.hWnd = hwnd;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16927
	    Shell_NotifyIcon(NIM_DELETE, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16928
	}
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16929
    }
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16930
%}
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16931
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16932
    "
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16933
     |v icon|
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16934
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16935
     v := StandardSystemView new.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16936
     v openAndWait.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16937
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16938
     icon := Icon stxIcon.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16939
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16940
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16941
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16942
	  toolTipMessage:'Hi There'.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16943
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16944
     Delay waitForSeconds:3.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16945
     icon := Tools::NewSystemBrowser defaultIcon.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16946
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16947
	  setTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16948
	  icon:icon iconMask:nil.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16949
     Delay waitForSeconds:3.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16950
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16951
	    removeTrayIconFor:v.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16952
    "
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16953
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16954
    "Created: / 05-11-2007 / 12:17:17 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16955
!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16956
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16957
setTrayIconFor:aView icon:wicon iconMask:wiconMaskArg
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16958
    "change the tray icon"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16959
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16960
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16961
     wiconWidth wiconHeight|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16962
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16963
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16964
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16965
    wicon notNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16966
	wiconId := (wicon asFormOn:self) id.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16967
	wiconHeight := wicon height.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16968
	wiconWidth  := wicon width.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16969
	wiconMask := wiconMaskArg.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16970
	wiconMask isNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16971
	    wiconMask := wicon mask.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16972
	].
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16973
	wiconMask notNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16974
	    "/ WIN32's mask has zeros for opaque pixels
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16975
	    invertedWiconMask := wiconMask copy.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16976
	    invertedWiconMask bits invert.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16977
	    invertedWiconMask := invertedWiconMask onDevice:self.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16978
	    wiconMaskId := invertedWiconMask id
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16979
	].
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16980
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16981
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16982
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16983
#ifndef WM_TRAY_MESSAGE
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16984
# define WM_TRAY_MESSAGE (WM_USER+0x200)
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16985
#endif
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16986
    HBITMAP        xBitMap, maskBitmap;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16987
    HICON          xIcon = (HICON)0;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16988
    ICONINFO       iconInfo;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16989
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16990
    unsigned char fastBits[10000];
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16991
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16992
    /* get bitmap for icon */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16993
    if ( __isExternalAddress(wiconId) ) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16994
	xBitMap = _HBITMAPVAL( wiconId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16995
	if ( xBitMap != 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16996
	    BITMAP bm;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16997
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16998
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16999
		int d = bm.bmPlanes * bm.bmBitsPixel;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17000
		BYTE *ep;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17001
		int height, width;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17002
		int nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17003
		unsigned char *allocatedBits = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17004
		int privateMask = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17005
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17006
		if ( __isExternalAddress(wiconMaskId) ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17007
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17008
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17009
		    if (wiconMaskId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17010
			PRINTF(("WinWorkstat [warning]: wiconMaskId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17011
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17012
		    maskBitmap = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17013
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17014
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17015
		/*
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17016
		 * if there is no mask, generate one
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17017
		 */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17018
		if (maskBitmap == 0) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17019
		    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
 17020
		    height = __intVal( wiconHeight );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17021
		    width  = __intVal( wiconWidth  );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17022
		    nBytes = ( width + 15 ) / 8;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17023
		    nBytes = height * nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17024
		    if (nBytes < sizeof(fastBits)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17025
			ep = fastBits;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17026
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17027
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17028
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17029
		    if ( ep == 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17030
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17031
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17032
			memset(ep, 0, nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17033
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17034
			if ( maskBitmap == NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17035
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17036
			} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17037
			    privateMask = 1;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17038
			}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17039
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17040
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17041
		if ( maskBitmap != NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17042
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17043
		    iconInfo.fIcon = TRUE;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17044
		    iconInfo.hbmMask  = maskBitmap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17045
		    iconInfo.hbmColor = xBitMap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17046
		    xIcon = CreateIconIndirect( &iconInfo );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17047
		    if (privateMask) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17048
			DeleteObject( maskBitmap );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17049
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17050
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17051
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17052
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17053
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17054
		if (allocatedBits) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17055
		    free(allocatedBits);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17056
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17057
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17058
	} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17059
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17060
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17061
    } else {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17062
	if (wiconId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17063
	    PRINTF(("WinWorkstat [warning]: wiconId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17064
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17065
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17066
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17067
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17068
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17069
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17070
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17071
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17072
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17073
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17074
	    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
 17075
			     // 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
 17076
	    nid.uFlags = NIF_ICON;      //our icon has a tooltip.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17077
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17078
	    if (xIcon) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17079
		nid.hIcon   = xIcon;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17080
		/* 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
 17081
	    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17082
		nid.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17083
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17084
	    Shell_NotifyIcon(NIM_MODIFY, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17085
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17086
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17087
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17088
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17089
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17090
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17091
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17092
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17093
     v openAndWait.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17094
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17095
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17096
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17097
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17098
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17099
	  toolTipMessage:'Hi There'.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17100
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17101
     Delay waitForSeconds:3.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17102
     icon := Tools::NewSystemBrowser defaultIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17103
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17104
	  setTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17105
	  icon:icon iconMask:nil.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17106
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17107
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17108
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17109
    "Created: / 31-10-2007 / 11:41:33 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17110
    "Modified: / 05-11-2007 / 12:19:12 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17111
!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17112
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17113
setTrayIconsToolTipMessageFor:aView to:toolTipMessageArg
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17114
    "Change the toolTopText.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17115
     Windows seems to have a bug here, in that while being shown,
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17116
     a change of the toolTipText is not immediately visible
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17117
     (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
 17118
     and reopened)
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17119
     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
 17120
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17121
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17122
     wiconWidth wiconHeight toolTipMessage|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17123
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17124
    "/ 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
 17125
    toolTipMessageArg size > 63 ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17126
	toolTipMessage := toolTipMessageArg copyTo:63
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17127
    ] ifFalse:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17128
	toolTipMessage := toolTipMessageArg.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17129
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17130
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17131
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17132
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17133
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17134
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17135
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17136
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17137
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17138
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17139
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17140
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17141
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17142
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17143
	    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
 17144
			     // 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
 17145
	    nid.uFlags = NIF_TIP;    //change the tooltip.
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 17146
	    if (__isStringLike(toolTipMessage)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17147
		strcpy(nid.szTip, __stringVal(toolTipMessage));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17148
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17149
	    Shell_NotifyIcon(NIM_MODIFY, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17150
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17151
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17152
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17153
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17154
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17155
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17156
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17157
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17158
     v openAndWait.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17159
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17160
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17161
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17162
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17163
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17164
	  toolTipMessage:'Hi There'.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17165
     1 to:5 do:[:i |
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17166
	 Delay waitForSeconds:2.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17167
	 Screen current
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17168
	      setTrayIconsToolTipMessageFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17169
	      to:(i printString).
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17170
     ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17171
     v destroy.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17172
    "
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
    "Created: / 31-10-2007 / 11:25:49 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17175
    "Modified: / 05-11-2007 / 12:20:53 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17176
! !
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17177
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17178
!WinWorkstation methodsFor:'window stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17179
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17180
activateWindow1:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 17181
    "make a window active (so that it gets the focus)"
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17182
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17183
%{  /* NOCONTEXT */
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17184
    if (__isExternalAddress(aWindowId)) {
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17185
	HWND win = _HWNDVal(aWindowId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17186
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17187
	if (win) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17188
	    CPRINTF(("activateWindow %x\n",win));
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4351
diff changeset
 17189
#if 0
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17190
	    ShowWindowAsync(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17191
#else
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17192
	    ShowWindow(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17193
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17194
	}
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17195
    }
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17196
%}
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17197
!
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17198
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17199
activateWindow2:aWindowId
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17200
    "make a window active (so that it gets the focus).
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17201
     Paranoid implementation."
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17202
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17203
%{  /* NOCONTEXT */
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17204
    if (__isExternalAddress(aWindowId)) {
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17205
	HWND win = _HWNDVal(aWindowId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17206
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17207
	if (win) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17208
	    DWORD activeThreadID, activeProcessID;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17209
	    DWORD myThreadID;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17210
	    HWND foregroundWindow = GetForegroundWindow();
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17211
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17212
	    if (foregroundWindow) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17213
		activeThreadID = GetWindowThreadProcessId(foregroundWindow, &activeProcessID);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17214
		myThreadID = GetCurrentThreadId();
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17215
		AttachThreadInput(activeThreadID, myThreadID, TRUE);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17216
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17217
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17218
	    // Do our stuff here ;-)
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17219
	    ShowWindow(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17220
	    SetForegroundWindow(win);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17221
	    SetFocus(win);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17222
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17223
	    if (foregroundWindow) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17224
		AttachThreadInput(activeThreadID, myThreadID, FALSE);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17225
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17226
	}
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17227
    }
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17228
%}
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17229
!
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17230
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17231
activateWindow:aWindowId
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17232
    "make a window active (so that it gets the focus)"
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17233
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17234
    "/ 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
 17235
    "/ we might try activate2 there.
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17236
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17237
    "/ self activateWindow1:aWindowId
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17238
    self activateWindow2:aWindowId
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17239
!
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17240
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17241
animateWindow:aWindowId show:doShow animation:animationSymbolorNil time:timeInMillisOrNil
4491
c011e738596f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4490
diff changeset
 17242
    "make a window visible/invisible with animation effect.
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17243
     CAVEAT:
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17244
	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
 17245
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17246
%{
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17247
    if (__isExternalAddress(aWindowId)) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17248
	HWND hWnd = _HWNDVal(aWindowId);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17249
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17250
	if (hWnd) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17251
	    DWORD how = (doShow == true) ? AW_ACTIVATE : AW_HIDE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17252
	    DWORD time = 0;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17253
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17254
	    CPRINTF(("mapWindowAnimated %x\n", hWnd));
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17255
	    if (animationSymbolorNil != nil) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17256
		if (__isSmallInteger(timeInMillisOrNil)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17257
		    time = __intVal(timeInMillisOrNil);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17258
		}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17259
		if (animationSymbolorNil == @symbol(SLIDE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17260
		    how |= AW_SLIDE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17261
		} else if (animationSymbolorNil == @symbol(BLEND)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17262
		    how |= AW_BLEND;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17263
		} else if (animationSymbolorNil == @symbol(CENTER)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17264
		    how |= AW_CENTER;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17265
		} else if (animationSymbolorNil == @symbol(HOR_POSITIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17266
		    how |= AW_HOR_POSITIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17267
		} else if (animationSymbolorNil == @symbol(HOR_NEGATIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17268
		    how |= AW_HOR_NEGATIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17269
		} else if (animationSymbolorNil == @symbol(VER_POSITIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17270
		    how |= AW_VER_POSITIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17271
		} else if (animationSymbolorNil == @symbol(VER_NEGATIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17272
		    how |= AW_VER_NEGATIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17273
		}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17274
	    }
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17275
	    AnimateWindow(hWnd, time, how);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17276
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17277
	RETURN ( self );
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17278
    }
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17279
%}
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17280
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17281
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17282
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17283
    "configure stacking operation of aWindowId w.r.t siblingId"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17284
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17285
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17286
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17287
dropFilesWindow:aWindowId accept:doAccept
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17288
    "window accept Files from Shell"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17289
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17290
%{  /*  */
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17291
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17292
    if (__isExternalAddress(aWindowId)) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17293
	HWND hWnd = _HWNDVal(aWindowId);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17294
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17295
	if (hWnd) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17296
	    if (doAccept == true)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17297
	    DragAcceptFiles(hWnd, (doAccept == true) ? TRUE : FALSE);
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17298
	}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17299
	RETURN ( self );
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17300
    }
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17301
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17302
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17303
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17304
findWindow:lpClassName windowName:lpWindowName
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 17305
    "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
 17306
     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
 17307
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17308
    ((lpClassName notNil and:[lpClassName bitsPerCharacter > 8])
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17309
    or:[ (lpWindowName notNil and:[lpWindowName bitsPerCharacter > 8]) ]) ifTrue:[
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17310
	^ self
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17311
	    primFindWindowW:(lpClassName isNil
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17312
				    ifTrue:[nil]
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17313
				    ifFalse:[lpClassName asUnicode16String asAsciiZ])
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17314
	    windowName:(lpWindowName isNil
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17315
				    ifTrue:[nil]
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17316
				    ifFalse:[lpWindowName asUnicode16String asAsciiZ])
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17317
    ].
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17318
    ^ self primFindWindowA:lpClassName windowName:lpWindowName
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17319
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17320
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17321
     |h|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17322
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17323
     h := Screen current findWindow:'Shell_TrayWnd' windowName:''.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17324
     Screen current prim_getWindowRect:h.
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17325
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17326
     Display findWindow:nil windowName:'ST/X Launcher'
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17327
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17328
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17329
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17330
getParentWindowIdOfWindowId:aChildWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17331
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17332
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17333
    if (__isExternalAddress(aChildWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17334
	HWND wChild = _HWNDVal(aChildWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17335
	HWND wParent;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17336
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17337
	if (wChild) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17338
	    wParent = GetParent(wChild);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17339
	    if (wParent) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17340
		RETURN ( __MKEXTERNALADDRESS(wParent) );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17341
	    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17342
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17343
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17344
%}.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17345
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17346
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17347
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17348
     |top v|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17349
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17350
     top := View new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17351
     v := View in:top.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17352
     top realize.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17353
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17354
     self assert:(Display getParentWindowIdOfWindowId:(v id)) = top id.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17355
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17356
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17357
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17358
getThreadIdOfWindowId:windowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17359
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17360
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17361
    if (__isExternalAddress(windowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17362
	HWND hwnd = _HWNDVal(windowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17363
	DWORD id;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17364
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17365
	if (hwnd) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17366
	    id = GetWindowThreadProcessId(hwnd, &id);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17367
	    RETURN ( __MKEXTERNALADDRESS(id) );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17368
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17369
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17370
%}.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17371
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17372
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17373
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17374
     |top|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17375
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17376
     top := View new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17377
     top realize.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17378
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17379
     self assert:(Display getThreadIdOfWindowId:(top id)) = OperatingSystem getProcessId.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17380
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17381
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17382
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17383
getWindowClassName:aWindowId
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17384
    "get a (possibly alien) window's class name"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17385
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17386
    |buffer n|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17387
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17388
    buffer := Unicode16String new:200.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17389
    n := self primGetWindowClassW:aWindowId into:buffer size:200.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17390
    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
 17391
	^ (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
 17392
    ].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17393
    self primitiveFailed.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17394
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17395
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17396
     |h|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17397
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17398
     h := Display findWindow:nil windowName:'ST/X Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17399
     Display getWindowClassName:h.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17400
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17401
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17402
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17403
     |h|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17404
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17405
     h := Display findWindow:nil windowName:'ST/XX Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17406
     Display getWindowText:h.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17407
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17408
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17409
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17410
getWindowIdFromThreadId:id
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17411
    |l|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17412
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17413
    l := OrderedCollection new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17414
    self primEnumWindowsInto:l.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17415
    l do:[:eachWindowId |
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17416
	(self getParentWindowIdOfWindowId:eachWindowId) isNil ifTrue:[
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17417
	    "/ a topView
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17418
	    (self getThreadIdOfWindowId:eachWindowId) = id ifTrue:[
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17419
		^ eachWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17420
	    ].
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17421
	]
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17422
    ].
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17423
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17424
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17425
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17426
     Display getWindowIdFromThreadId:(OperatingSystem getProcessId)
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17427
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17428
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17429
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17430
getWindowRectangle:aWindowId
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17431
    "get a (possibly alien) window's screen rectangle"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17432
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17433
    |bytes|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17434
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17435
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17436
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17437
    bytes := ByteArray new:(ExternalBytes sizeofLong*4).
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17438
    self primGetWindowRect:aWindowId lpRect:bytes.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17439
    ^ Rectangle
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17440
	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
 17441
	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
 17442
	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
 17443
	bottom:(bytes longAt:13)
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17444
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17445
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17446
     |handle|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17447
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17448
     handle := Display findWindow: nil windowName: 'ST/X Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17449
     (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
 17450
     Display getWindowRectangle:handle.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17451
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17452
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17453
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17454
getWindowText:aWindowId
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17455
    "get a (possibly alien) window's title text"
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17456
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17457
    |buffer n|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17458
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17459
    buffer := Unicode16String new:200.
5334
da0ae55ea30f code cleanup
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
 17460
    n := self primGetWindowTextW:aWindowId into:buffer size:200.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17461
    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
 17462
	^ (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
 17463
    ].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17464
    self primitiveFailed.
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17465
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17466
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17467
     |h|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17468
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17469
     h := Display findWindow:nil windowName:'ST/X Launcher'.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17470
     Display getWindowText:h.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17471
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17472
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17473
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17474
     |h|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17475
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17476
     h := Display findWindow:nil windowName:'ST/XX Launcher'.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17477
     Display getWindowText:h.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17478
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17479
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17480
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17481
isValidWindowId:aWindowId
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17482
    "return true, if the given window ID is (still) valid.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17483
     Especially useful, if the passed windowID is
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17484
     an alien (external) windows id."
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17485
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17486
%{
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17487
    if (__isExternalAddress(aWindowId)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17488
	HWND win = _HWNDVal(aWindowId);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17489
	DWORD threadID, processID = 0;
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17490
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17491
	if (! IsWindow(win)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17492
	    RETURN (false);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17493
	}
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17494
	threadID = GetWindowThreadProcessId(win, &processID);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17495
	if ((threadID==0) || (processID==0)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17496
	    RETURN (false);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17497
	}
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17498
	RETURN (true);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17499
    }
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17500
%}.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17501
    self primitiveFailed.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17502
    ^ false
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17503
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17504
    "
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17505
     |v aWindowId ok|
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17506
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17507
     v := StandardSystemView new.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17508
     v label:'hello'.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17509
     v openAndWait.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17510
     aWindowId := v id.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17511
     ok := Display isValidWindowId:aWindowId.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17512
     Transcript showCR:'ok is: ' , ok printString.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17513
     Delay waitForSeconds:1.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17514
     v destroy.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17515
     Delay waitForSeconds:0.5.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17516
     ok := Display isValidWindowId:aWindowId.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17517
     Transcript showCR:'ok is: ' , ok printString.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17518
    "
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17519
!
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17520
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17521
lowerWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17522
    "bring a window to back"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17523
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17524
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17525
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17526
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17527
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17528
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17529
	if (win) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 17530
	    CPRINTF(("lowerWindow %x\n",win));
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17531
	    SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 17532
			 SWP_NOSENDCHANGING |
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 17533
			 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17534
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17535
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17536
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17537
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17538
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17539
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17540
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
 17541
    "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
 17542
     in addition, allow change of extend, position, minExtend and maxExtent.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17543
     Needed for restart, to allow recreating a view as iconified,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17544
     and to collaps/expand windows."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17545
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17546
    |minW minH maxW maxH|
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17547
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17548
    minExt notNil ifTrue:[
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17549
	minW := minExt x.
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17550
	minH := minExt y.
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17551
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17552
    maxExt notNil ifTrue:[
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17553
	maxW := maxExt x.
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17554
	maxH := maxExt y.
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17555
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17556
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17557
%{
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17558
    if (__isExternalAddress(aWindowId)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17559
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17560
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17561
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17562
	    int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17563
	    int flag = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17564
	    int __left, __top, __width, __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17565
	    int winStyleBits;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17566
	    int winExStyleBits;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17567
	    localWindowInfo *lI;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17568
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17569
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17570
	    winStyleBits = GetWindowLong(win, GWL_STYLE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17571
	    winExStyleBits = GetWindowLong(win, GWL_EXSTYLE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17572
	    lI = GETLOCALWINDOWINFOPTR(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17573
	    if (! lI) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17574
		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
 17575
		RETURN (self);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17576
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17577
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17578
	    if (__bothSmallInteger(x, y)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17579
		__left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17580
		__top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17581
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17582
		__left = __top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17583
		flag |= SWP_NOMOVE;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17584
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17585
	    if (__bothSmallInteger(w, h)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17586
		__width = __intVal(w) - bw - bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17587
		__height = __intVal(h) - bw - bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17588
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17589
		__width = __height = 100;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17590
		flag |= SWP_NOSIZE;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17591
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17592
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17593
	    if (__bothSmallInteger(minW, minH)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17594
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17595
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17596
		rec.left = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17597
		rec.top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17598
		rec.right = __intVal(minW);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17599
		rec.bottom = __intVal(minH);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17600
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17601
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17602
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17603
		lI->minWidth = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17604
		lI->minHeight = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17605
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17606
	    if (__bothSmallInteger(maxW, maxH)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17607
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17608
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17609
		rec.left = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17610
		rec.top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17611
		rec.right = __intVal(maxW);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17612
		rec.bottom = __intVal(maxH);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17613
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17614
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17615
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17616
		lI->maxWidth = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17617
		lI->maxHeight = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17618
	    }
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17619
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17620
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17621
	    if (flag != (SWP_NOMOVE | SWP_NOSIZE)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17622
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17623
		int __left0, __top0, __width0, __height0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17624
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17625
		__left0   = __left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17626
		__top0    = __top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17627
		__width0  = __width;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17628
		__height0 = __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17629
5545
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 17630
		rec.left = __left;
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 17631
		// rec.left = __left-2;
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 17632
		rec.top = __top;
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 17633
		// rec.top = __top-2;
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17634
		rec.right = rec.left + __width;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17635
		rec.bottom = rec.top + __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17636
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17637
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17638
		__left = rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17639
		__top = rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17640
		__width = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17641
		__height = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17642
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17643
		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
 17644
			 win,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17645
			 __left0, __top0, __width0, __height0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17646
			 __left, __top, __width, __height));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17647
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17648
#else
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17649
	    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
 17650
		     win,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17651
		     __left, __top, __width, __height));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17652
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17653
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17654
	    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
 17655
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17656
	    if (aBoolean == true) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17657
		/* iconified */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17658
//              SetWindowPos(win, (HWND)0,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17659
//                           __left, __top, __width, __height,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17660
//                           flag);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17661
//                ShowWindow(win, SW_SHOWMINIMIZED);
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17662
		ShowWindowAsync(win, SW_SHOWMINNOACTIVE);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 17663
/*
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17664
		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
 17665
*/
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17666
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17667
		/* normal */
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17668
		SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17669
			     __left, __top, __width, __height,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17670
			     flag);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 17671
/*
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17672
		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
 17673
*/
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17674
		//ShowWindow(win, SW_RESTORE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17675
		// ShowWindowAsync(win, SW_RESTORE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17676
		ShowWindowAsync(win, SW_SHOWNOACTIVATE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17677
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17678
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17679
	RETURN ( self );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17680
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17681
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17682
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17683
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17684
mapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17685
    "make a window visible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17686
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17687
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17688
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17689
    if (__isExternalAddress(aWindowId)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17690
	HWND hWnd = _HWNDVal(aWindowId);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17691
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17692
	if (hWnd) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17693
	    CPRINTF(("mapWindow %x\n", hWnd));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17694
	    if (GetParent(hWnd) == 0) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17695
		ShowWindowAsync(hWnd, SW_SHOWNOACTIVATE);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17696
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17697
		ShowWindowAsync(hWnd, SW_SHOWNORMAL);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17698
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17699
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17700
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17701
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17702
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17703
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17704
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17705
mapWindow:aWindowId animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17706
    "make a window visible with some animation effect"
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17707
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17708
    self animateWindow:aWindowId show:true animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17709
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17710
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17711
moveResizeWindow:aWindowId x:x y:y width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17712
    "move and resize a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17713
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17714
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17715
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17716
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17717
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17718
     && __bothSmallInteger(w, h)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17719
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17720
	int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17721
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17722
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17723
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17724
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17725
	    rec.left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17726
	    rec.top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17727
	    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
 17728
	    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
 17729
	    if (GetParent(win) == 0) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17730
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17731
		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
 17732
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17733
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17734
	    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
 17735
			 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
 17736
	    SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17737
			 rec.left, rec.top,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17738
			 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
 17739
			 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
 17740
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17741
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17742
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17743
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17744
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17745
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17746
moveWindow:aWindowId x:x y:y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17747
    "move a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17748
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17749
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17750
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17751
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17752
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17753
     && __bothSmallInteger(x, y)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17754
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17755
	int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17756
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17757
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17758
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17759
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17760
	    rec.left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17761
	    rec.top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17762
	    if (GetParent(win) == 0) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17763
		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
 17764
		rec.bottom = rec.top + 10;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17765
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17766
		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
 17767
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17768
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17769
	    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
 17770
			__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
 17771
	    SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17772
			 rec.left, rec.top,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17773
			 0, 0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17774
			 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
 17775
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17776
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17777
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17778
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17779
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17780
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17781
primEnumChildWindowsOf:aWindowId into:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17782
%{
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17783
    if (__isExternalAddress(aWindowId)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 17784
	HWND hwParent = _HWNDVal(aWindowId);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 17785
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 17786
	if ( EnumChildWindows( hwParent, EnumWindowsProc, (DWORD)&(handleList))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 17787
	    DPRINTF(("EnumChildWindows successful\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 17788
	}
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17789
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17790
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17791
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17792
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17793
primEnumWindowsInto:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17794
%{
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17795
    if ( EnumWindows( EnumWindowsProc, (DWORD)&(handleList))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 17796
	DPRINTF(("EnumWindows successful\n"));
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17797
    }
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17798
%}
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17799
!
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17800
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17801
primEnumWindowsOf:threadId into:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17802
%{
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17803
    if (__isSmallInteger(threadId)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 17804
	if ( EnumThreadWindows( __intVal(threadId), EnumWindowsProc, (DWORD)&(handleList))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 17805
	    DPRINTF(("EnumThreadWindows successful\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 17806
	}
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17807
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17808
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17809
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17810
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17811
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
 17812
    "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
 17813
     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
 17814
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17815
    <apicall: handle "FindWindowA" (lpstr lpstr) module: "user32.dll" >
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17816
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17817
    "
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17818
     self primFindWindow: nil windowName: 'WORK2 ST/X Launcher [FELIXM]'
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17819
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17820
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17821
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17822
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
 17823
    "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
 17824
     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
 17825
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17826
    <apicall: handle "FindWindowW" (lpstr lpstr) module: "user32.dll" >
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17827
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17828
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17829
     self primFindWindow: nil windowName: 'WORK2 ST/X Launcher [FELIXM]' asAsciiZ
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17830
    "
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17831
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17832
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17833
primGetWindowClassW:aWindowId into:buffer size:maxSize
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17834
    "get a window's class name"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17835
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17836
    <apicall: int "GetClassNameW" (handle, pointer, int) module: "user32.dll" >
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17837
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17838
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17839
primGetWindowRect:aWindowId lpRect:lpRect
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17840
    "get a window's screen rectangle"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17841
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17842
    <apicall: int "GetWindowRect" (handle, pointer) module: "user32.dll" >
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17843
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17844
5334
da0ae55ea30f code cleanup
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
 17845
primGetWindowTextW:aWindowId into:buffer size:maxSize
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17846
    "get a window's title text"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17847
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17848
    <apicall: int "GetWindowTextW" (handle, pointer, int) module: "user32.dll" >
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17849
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17850
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17851
primSendMessage:aWindowId message:message wParam:wParam lParam:lParam
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17852
    "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
 17853
     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
 17854
     does not return until the target's window procedure has processed the message."
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17855
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17856
    <apicall: bool "SendMessageA" (handle uint ulong ulong) module: "user32.dll" >
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17857
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17858
5027
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17859
primSetForegroundWindow: aWindowId
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17860
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17861
    "
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17862
    If the window was brought to the foreground, the return value is nonzero.
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17863
    If the window was not brought to the foreground, the return value is zero.
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17864
    "
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17865
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17866
    <apicall: bool "SetForegroundWindow" (handle) module: "user32.dll" >
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17867
!
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17868
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17869
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
 17870
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17871
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17872
    HBITMAP        xBitMap, maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17873
    ICONINFO       iconInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17874
    int            height, width;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17875
    HICON          xIcon = (HICON)0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17876
    unsigned char  fastBits[10000];
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17877
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17878
    DPRINTF(("primSetWindowIconId\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17879
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17880
     && __isExternalAddress(wiconId)
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17881
     && __bothSmallInteger(wiconWidth, wiconHeight)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17882
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17883
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17884
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17885
	if ( xBitMap != 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17886
	    BITMAP bm;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17887
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17888
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17889
		BYTE *ep;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17890
		int privateMask = 0;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
 17891
		unsigned char  *allocatedBits = 0;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17892
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17893
		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
 17894
		height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17895
		width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17896
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17897
		if ( __isExternalAddress(wmaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17898
		    maskBitmap = _HBITMAPVAL( wmaskId );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17899
		} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17900
		    if (wmaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17901
			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
 17902
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17903
		    maskBitmap = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17904
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17905
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17906
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17907
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17908
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17909
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17910
		    int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17911
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17912
		    nBytes = ( width + 31 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17913
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17914
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17915
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17916
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17917
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17918
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17919
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17920
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17921
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17922
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17923
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17924
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17925
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17926
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17927
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17928
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17929
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17930
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17931
		if ( maskBitmap != NULL ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17932
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17933
		    iconInfo.fIcon = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17934
		    iconInfo.hbmMask  =maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17935
		    iconInfo.hbmColor = xBitMap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17936
		    xIcon = CreateIconIndirect( &iconInfo );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17937
		    DPRINTF(( "ICON CREATED!!!\n" ));
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17938
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 17939
			_DeleteObject( maskBitmap, __LINE__ );
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17940
		    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17941
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17942
		    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
 17943
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17944
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17945
		if (allocatedBits) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17946
		    free(allocatedBits);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17947
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17948
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17949
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17950
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17951
	}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17952
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17953
	if (xIcon) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 17954
#ifndef TOPWINDOWCLASS
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17955
	    HICON oldIcon = (HICON)0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17956
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17957
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17958
	    SetClassLong(win, GCL_HICON, (DWORD)xIcon);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17959
/* It has to be checked whether this can be deleted!!!!! */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17960
	    if ( oldIcon ) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17961
		if (DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17962
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17963
		} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 17964
		    console_fprintf(stderr, "failed to delete old icon\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17965
		}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17966
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 17967
#else
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17968
	    SendMessage(win, WM_SETICON,ICON_SMALL, (LPARAM)xIcon);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17969
	    SendMessage(win, WM_SETICON,ICON_BIG, (LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 17970
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17971
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17972
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17973
    }
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
raiseWindow:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 17978
    "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
 17979
     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
 17980
     as topmost, when it gets the focus)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17981
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17982
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17983
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17984
    if (__isExternalAddress(aWindowId)) {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17985
	HWND hWnd = _HWNDVal(aWindowId);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17986
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17987
	if (hWnd) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17988
	    CPRINTF(("raiseWindow %x\n",hWnd));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17989
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17990
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17991
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17992
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17993
	}
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17994
    }
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17995
%}
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17996
!
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17997
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17998
raiseWindowToTop:aWindowId
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17999
    "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
 18000
     Q: is this a windows-specific thing ?"
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18001
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18002
%{  /* NOCONTEXT */
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18003
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18004
    if (__isExternalAddress(aWindowId)) {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18005
	HWND hWnd = _HWNDVal(aWindowId);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18006
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18007
	if (hWnd) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18008
	    CPRINTF(("raiseWindow %x\n",hWnd));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18009
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18010
	    SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18011
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18012
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18013
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18014
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18015
	    SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18016
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18017
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18018
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18019
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18020
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18021
			/* SWP_NOOWNERZORDER | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18022
			/* SWP_NOSENDCHANGING | SWP_NOACTIVATE | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18023
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18024
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18025
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18026
			/* SWP_NOOWNERZORDER | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18027
			/* SWP_NOSENDCHANGING | SWP_NOACTIVATE | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18028
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18029
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18030
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18031
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18032
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18033
4441
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18034
reparentWindow:windowId to:newParentWindowId
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18035
    "change a windows parent (an optional interface)"
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18036
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18037
%{
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18038
    if (__isExternalAddress(windowId)
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18039
     && __isExternalAddress(newParentWindowId)) {
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18040
	HWND hWnd = _HWNDVal(windowId);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18041
	HWND hWndNewParent = _HWNDVal(newParentWindowId);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18042
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18043
	SetParent(hWnd, hWndNewParent);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18044
	RETURN ( true );
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18045
    }
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18046
%}.
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18047
    self primitiveFailed
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18048
!
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18049
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18050
resizeWindow:aWindowId width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18051
    "resize a window"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18052
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18053
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18054
    RECT rec;
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18055
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18056
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18057
     && __bothSmallInteger(w, h)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18058
	HWND hWnd = _HWNDVal(aWindowId);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18059
	int bw;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18060
2593
1d2dad16f32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
 18061
	if (hWnd) {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18062
	    bw = GetWindow_bw(hWnd);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18063
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 18064
	    rec.left = 0;  /* only needed to have a valid origin in adjust */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 18065
	    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
 18066
	    rec.right = __intVal(w) - bw - bw;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18067
	    rec.bottom = __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18068
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18069
	    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
 18070
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18071
	    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
 18072
	    SetWindowPos(hWnd, (HWND)0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18073
			 0, 0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18074
			 rec.right - rec.left, rec.bottom - rec.top,
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18075
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18076
			 SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18077
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18078
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18079
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18080
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18081
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18082
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18083
sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18084
    "send a button message to a window by id (handle)"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18085
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18086
    |wParam lParam result|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18087
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18088
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18089
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18090
    wParam := 0.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18091
    lParam := (aPoint x) + (aPoint y bitShift:16).
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18092
    result := self primSendMessage:aWindowId message:messageType wParam:wParam lParam:lParam.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18093
    ^ result
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18094
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18095
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18096
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18097
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18098
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18099
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18100
     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
 18101
     v openAndWait.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18102
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18103
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18104
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18105
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18106
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18107
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18108
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18109
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18110
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18111
sendButtonPress:button at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18112
    "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
 18113
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18114
    |messageType|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18115
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18116
    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
 18117
    messageType := #(   16r0201 "WM_LBUTTONDOWN"
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18118
			16r0207 "WM_MBUTTONDOWN"
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18119
			16r0204 "WM_RBUTTONDOWN"  ) at:button.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18120
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18121
    self sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18122
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18123
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18124
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18125
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18126
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18127
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18128
     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
 18129
     v openAndWait.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18130
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18131
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18132
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18133
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18134
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18135
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18136
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18137
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18138
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18139
sendButtonRelease:button at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18140
    "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
 18141
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18142
    |messageType|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18143
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18144
    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
 18145
    messageType := #(   16r0202 "WM_LBUTTONUP"
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18146
			16r0208 "WM_MBUTTONUP"
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18147
			16r0205 "WM_RBUTTONUP"  ) at:button.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18148
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18149
    self sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18150
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18151
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18152
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18153
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18154
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18155
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18156
     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
 18157
     v openAndWait.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18158
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18159
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18160
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18161
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18162
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18163
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18164
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18165
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18166
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18167
sendCopyData: aByteArray toWindowId: aWindowId
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18168
    "send copy-paste data to a window by id (handle)"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18169
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18170
    |externalBytes messageType wParam lParam copyDataStruct result|
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18171
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18172
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18173
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18174
    messageType := 74 "WM_COPYDATA".
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18175
    wParam := 0.
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18176
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18177
    copyDataStruct := CopyDataStructStructure new.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18178
    copyDataStruct cbData:aByteArray size.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18179
    externalBytes := ExternalBytes from:aByteArray.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18180
    copyDataStruct lpData:externalBytes address.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18181
    lParam := ExternalBytes from:copyDataStruct.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18182
    result := self primSendMessage:aWindowId message:messageType wParam:wParam lParam:lParam address.
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18183
    externalBytes free.
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18184
    lParam free.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18185
    ^ result
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18186
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18187
    "
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18188
     |string bytes externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18189
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18190
     string := 'c:\pipo.net' , 0 asCharacter asString.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18191
     bytes := string asByteArray.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18192
     handle := Display primFindWindow: nil windowName: 'ST/X Launcher [FELIXM]' asAsciiZ.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18193
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18194
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18195
     Display setForegroundWindow: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18196
     Display sendCopyData: bytes toWindowId: externalAddress.
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18197
    "
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18198
!
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18199
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18200
sendCopyDataString: aString toWindowId: aWindowId
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18201
    "send a string as copy-paste data to a window by id (handle)"
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18202
5025
56bac82aef63 fix #sendCopyDataString: toWindowId:
fm
parents: 5024
diff changeset
 18203
    |aByteArray nullTerminatedString |
56bac82aef63 fix #sendCopyDataString: toWindowId:
fm
parents: 5024
diff changeset
 18204
56bac82aef63 fix #sendCopyDataString: toWindowId:
fm
parents: 5024
diff changeset
 18205
    nullTerminatedString := aString , 0 asCharacter asString.
56bac82aef63 fix #sendCopyDataString: toWindowId:
fm
parents: 5024
diff changeset
 18206
    aByteArray := nullTerminatedString asByteArray.
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18207
    self sendCopyData: aByteArray toWindowId: aWindowId
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18208
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18209
    "
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18210
     |string externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18211
     string := 'c:\pipo.net' , 0 asCharacter asString.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18212
     handle := Display primFindWindow: nil windowName: 'WORK6 ST/X Launcher [FELIXM]' asAsciiZ.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18213
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18214
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18215
     Display setForegroundWindow: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18216
     Display sendCopyDataString: string toWindowId: externalAddress.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18217
    "
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18218
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18219
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18220
setBackingStore:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18221
    "turn on/off backing-store for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18222
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18223
    "/ 'WinWorkstation [info]: setBackingStore:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18224
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18225
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18226
setBitGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18227
    "set bit gravity for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18228
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18229
    "/ 'WinWorkstation [info]: setBitGravity:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18230
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18231
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18232
setCursor:aCursorId in:aWindowId
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18233
    "define a cursor for a window"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18234
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18235
%{  /* NOCONTEXT */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18236
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18237
    HCURSOR newCursor;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18238
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18239
    if (ISCONNECTED
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18240
     && __isExternalAddress(aWindowId)
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18241
     && __isExternalAddress(aCursorId)) {
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18242
	HWND win = _HWNDVal(aWindowId);
5521
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18243
//        POINT p;
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18244
//        GUITHREADINFO info;
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18245
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18246
	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
 18247
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18248
	/*
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18249
	 * 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
 18250
	 * 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
 18251
	 * 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
 18252
	 * 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
 18253
	 */
5521
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18254
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18255
// forget about the GetGUIThreadInfo stuff (although it works) - __currentPointerView is easier
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18256
//        info.cbSize = sizeof(info);
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18257
//        if (GetGUIThreadInfo(0, &info) == 0) {
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18258
//            info.hwndCapture = 0;               // set to defined value on failure
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18259
//        }
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18260
//        if (info.hwndCapture == win
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18261
//            || (GetCursorPos(&p), WindowFromPoint(p) == win)) {
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18262
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18263
	if (win == __currentPointerView) {
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18264
#if defined(SET_CURSOR_IN_WINTHREAD)
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18265
	    PostMessage(win, WM_THREAD_SETCURSOR, 0, (INT)_HCURSORVal(aCursorId));
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18266
#else
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18267
	    SetCursor(_HCURSORVal(aCursorId));
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18268
#endif
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18269
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18270
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18271
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18272
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18273
4439
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18274
setForegroundWindow2:aWindowId
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18275
    "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
 18276
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18277
%{  /* NOCONTEXT */
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18278
    if (__isExternalAddress(aWindowId)) {
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18279
	HWND win = _HWNDVal(aWindowId);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18280
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18281
	if (win) {
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18282
	    ShowWindow(win, SW_SHOW);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18283
	    SetForegroundWindow(win);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18284
	    BringWindowToTop(win);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18285
	}
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18286
	RETURN ( self );
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18287
    }
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18288
%}
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18289
!
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18290
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18291
setForegroundWindow:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18292
    "make a window the foreground window.
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18293
     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
 18294
     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
 18295
     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
 18296
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18297
%{  /* NOCONTEXT */
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18298
    if (__isExternalAddress(aWindowId)) {
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18299
	HWND win = _HWNDVal(aWindowId);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18300
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18301
	if (win) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18302
	    CPRINTF(("setForegroundWindow %x\n",win));
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18303
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18304
	    SetForegroundWindow(win);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18305
	}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18306
	RETURN ( self );
4439
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18307
    }
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18308
%}
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18309
!
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18310
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18311
setIconName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18312
    "define a windows iconname"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18313
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18314
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18315
#if 0
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18316
    if (__isExternalAddress(aWindowId)
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 18317
     && (__isStringLike(aString))) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18318
	HWND win = _HWNDVal(aWindowId);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18319
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18320
	SetWindowText(win, __stringVal(aString));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18321
	RETURN (self);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18322
    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18323
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18324
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18325
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18326
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18327
setParentWindowIdOf:aChildWindowId to:newParentWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18328
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18329
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18330
    if (__isExternalAddress(aChildWindowId)
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18331
     && __isExternalAddress(newParentWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18332
	HWND wChild = _HWNDVal(aChildWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18333
	HWND wNewParent = _HWNDVal(newParentWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18334
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18335
	if (wChild && wNewParent) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18336
	    SetParent(wChild, wNewParent);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18337
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18338
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18339
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18340
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18341
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18342
setSaveUnder:yesOrNo in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18343
    "turn on/off save-under for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18344
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18345
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18346
    if (yesOrNo != false) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18347
	DPRINTF(("WinWorkstation [info]: setSaveUnder:in: not (yet) implemented\n"));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18348
    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18349
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18350
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18351
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18352
setTransient:aWindowId for:aMainWindowId
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18353
    "set aWindowId to be a transient of aMainWindow.
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18354
     This will make the transient window to be iconified/deiconified
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18355
     together with the mainWindow.
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18356
     Typically, this is set for modal dialogs."
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18357
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18358
%{  /* NOCONTEXT */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18359
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18360
#ifdef NOT_YET_SUPPORTED
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18361
    if (__isExternalAddress(aWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18362
	HWND w;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18363
	HWND cw = _HWNDVal(aWindowId);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18364
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18365
	if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18366
	    w = (HWND) 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18367
	} else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18368
	    if (__isExternalAddress(aMainWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18369
		w = _HWNDVal(aMainWindowId);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18370
	    } else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18371
		goto getOutOfHere;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18372
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18373
	}
2417
1e40a40e56e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2416
diff changeset
 18374
	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
 18375
	//SetParent(cw, w);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18376
	RETURN ( self );
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18377
    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18378
 getOutOfHere: ;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18379
#else
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18380
    RETURN (self);
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18381
#endif
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18382
%}.
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18383
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18384
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18385
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18386
setWindowBackground:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18387
    "set the windows background color. This is the color with which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18388
     the view is filled whenever exposed. Do not confuse this with
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18389
     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
 18390
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18391
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18392
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18393
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18394
     && (__isSmallInteger(aColorIndex))) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18395
	HWND hWnd = _HWNDVal(aWindowId);
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18396
	int clr;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18397
	HBRUSH oldBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18398
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18399
	oldBrush = GetWindow_viewBgBrush(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18400
	if (oldBrush) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18401
	    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18402
	    _DeleteBrushIfNotInCache(oldBrush, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18403
	}
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18404
	clr = st2RGB(__intVal(aColorIndex), 0);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18405
	SetWindow_viewBgColor(hWnd, clr);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18406
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18407
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18408
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18409
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18410
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18411
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18412
setWindowBackgroundPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18413
    "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
 18414
     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
 18415
     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
 18416
     with opaque drawing.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18417
     NOTICE: due to the limitations of WIN95,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18418
	     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
 18419
	     are handled by smalltalk code in the WIN95 version."
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18420
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18421
%{
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18422
    if (__isExternalAddress(aWindowId)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18423
	HWND hWnd = _HWNDVal(aWindowId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18424
	HBITMAP pixmap;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18425
	HBRUSH oldBrush, newBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18426
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18427
	if (__isExternalAddress(aPixmapId))
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18428
	    pixmap = _HBITMAPVAL(aPixmapId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18429
	else
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18430
	    pixmap = 0;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18431
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18432
	oldBrush = GetWindow_viewBgBrush(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18433
	if (oldBrush) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18434
	    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18435
	    _DeleteBrushIfNotInCache(oldBrush, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18436
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18437
	if (pixmap) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18438
	    newBrush = CreatePatternBrush(pixmap);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 18439
	    SetWindow_viewBgBrush(hWnd, newBrush);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18440
/*
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18441
 *            SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18442
 */
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18443
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18444
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18445
	RETURN (self);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18446
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18447
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18448
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18449
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18450
setWindowBorderColor:aColorIndex in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18451
    "set the windows border color.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18452
     NOTICE: borders are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18453
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18454
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18455
    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
 18456
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18457
    if (__isExternalAddress(aWindowId)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18458
     && __isSmallInteger(aColorIndex)) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18459
	HWND win = _HWNDVal(aWindowId);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18460
	int clr;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18461
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18462
	if (GetParent(win) != 0) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18463
	    clr = st2RGB(__intVal(aColorIndex), 0);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18464
	    SetWindow_bdColor(win, clr);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18465
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18466
	    {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18467
		/*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18468
		 * 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
 18469
		 * border colors ... (see UIPainter code)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18470
		 */
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18471
		RECT rect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18472
		HRGN rgn;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18473
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18474
		GetWindowRect(win, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18475
		rgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 18476
		DefWindowProcW(win, WM_NCPAINT, (WPARAM)rgn, 0);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18477
		_DeleteObject(rgn, __LINE__);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18478
	    }
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18479
	}
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18480
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18481
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18482
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18483
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18484
setWindowBorderPixmap:aPixmapId in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18485
    "set the windows border pattern.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18486
     NOTICE: border pixmaps are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18487
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18488
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18489
    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
 18490
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18491
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18492
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18493
setWindowBorderWidth:aNumber in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18494
    "set the windows border width.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18495
     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
 18496
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18497
%{  /* NOCONTEXT */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18498
    int bw = (aNumber == __MKSMALLINT(0)) ? 0 : 1;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18499
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18500
    if (__isExternalAddress(aWindowId)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18501
	HWND win = _HWNDVal(aWindowId);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18502
	int gwl;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18503
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18504
	gwl = GetWindowLong(win, GWL_STYLE);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18505
	if (gwl & WS_CHILD) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18506
	    SetWindow_bw(win, bw);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18507
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18508
	    if (bw) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18509
		gwl |= WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18510
	    } else {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18511
		gwl &= ~WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18512
	    }
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18513
	    SetWindowLong(win, GWL_STYLE, gwl);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18514
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18515
	    /*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18516
	     * 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
 18517
	     * border colors ... (see UIPainter code)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18518
	     */
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 18519
#if 0
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18520
	    PostMessage(win, WM_NCPAINT, 0, 0);
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 18521
#endif
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18522
	    {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18523
		RECT rect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18524
		HRGN rgn;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18525
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18526
		GetWindowRect(win, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18527
		rgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 18528
		DefWindowProcW(win, WM_NCPAINT, (WPARAM)rgn, 0);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18529
		_DeleteObject(rgn, __LINE__);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18530
	    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18531
	}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18532
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18533
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18534
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18535
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18536
setWindowClass:wClass name:wName in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18537
    "define class and name of a window.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18538
     This may be used by the window manager to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18539
     select client specific resources."
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18540
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18541
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18542
    DPRINTF(("WinWorkstation [info]: setWindowClass:name:in: not (yet) implemented\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18543
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18544
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18545
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18546
setWindowGravity:how in:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18547
    "set the window gravity - this makes the view to move
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18548
     automatically and can avoid redraws (if used properly)"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18549
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18550
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18551
    int gr = GRAVITY_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18552
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18553
    if (__isExternalAddress(aWindowId)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18554
	HWND hWnd = _HWNDVal(aWindowId);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18555
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18556
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18557
	if (how == @symbol(South)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18558
	    gr = GRAVITY_S;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18559
	} else if (how == @symbol(SouthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18560
	    gr = GRAVITY_SW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18561
	} else if (how == @symbol(SouthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18562
	    gr = GRAVITY_SE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18563
	} else if (how == @symbol(North)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18564
	    gr = GRAVITY_N;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18565
	} else if (how == @symbol(NorthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18566
	    gr = GRAVITY_NW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18567
	} else if (how == @symbol(NorthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18568
	    gr = GRAVITY_NE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18569
	} else if (how == @symbol(East)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18570
	    gr = GRAVITY_E;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18571
	} else if (how == @symbol(West)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18572
	    gr = GRAVITY_W;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18573
	}
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18574
	lI = GETLOCALWINDOWINFOPTR(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18575
	if (lI) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18576
	    lI->viewGravity = gr;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18577
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18578
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18579
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18580
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18581
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18582
setWindowIcon:aForm mask:aMaskForm in:aWindowId
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18583
    "set a windows icon & iconMask"
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18584
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18585
    |wiconId wmaskId wiconHeight wiconWidth|
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18586
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18587
    aForm notNil ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18588
	wiconId := aForm id.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18589
	wiconHeight := aForm height.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18590
	wiconWidth  := aForm width.
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18591
	aMaskForm notNil ifTrue:[
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18592
	    wmaskId := aMaskForm id
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18593
	].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18594
	self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18595
	    primSetWindowIconId:wiconId
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18596
	    maskId:wmaskId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18597
	    width:wiconWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18598
	    height:wiconHeight
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18599
	    in:aWindowId
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18600
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18601
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18602
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18603
setWindowIconWindow:aView in:aWindowId
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18604
    "define a window to be used as icon.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18605
     This is not supported with Windows (is it possible at all ?)."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18606
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18607
    'WinWorkstation [info]: setWindowIconWindow:in: not implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18608
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18609
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18610
setWindowMinExtent:minExt maxExtent:maxExt in:aWindowId
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18611
    "set a windows minimum & max extents.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18612
     nil arguments are ignored."
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18613
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18614
    |minW minH maxW maxH|
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18615
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18616
    minExt notNil ifTrue:[
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18617
	minW := minExt x.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18618
	minH := minExt y.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18619
    ].
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18620
    maxExt notNil ifTrue:[
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18621
	maxW := maxExt x.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18622
	maxH := maxExt y.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18623
    ].
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18624
%{
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18625
    if (__isExternalAddress(aWindowId)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18626
	HWND win = _HWNDVal(aWindowId);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18627
	RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18628
	int winStyleBits;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18629
	int winExStyleBits;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18630
	localWindowInfo *lI;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18631
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18632
	if (win) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18633
	    winStyleBits = GetWindowLong(win, GWL_STYLE);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18634
	    winExStyleBits = GetWindowLong(win, GWL_EXSTYLE);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18635
	    lI = GETLOCALWINDOWINFOPTR(win);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18636
	    if (! lI) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 18637
		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
 18638
		RETURN (self);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18639
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18640
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18641
	    if (__bothSmallInteger(minW, minH)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18642
		RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18643
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18644
		rec.left = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18645
		rec.top = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18646
		rec.right = __intVal(minW);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18647
		rec.bottom = __intVal(minH);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18648
#ifdef ADJUSTWINDOW
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18649
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18650
#endif
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18651
		lI->minWidth = rec.right - rec.left;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18652
		lI->minHeight = rec.bottom - rec.top;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18653
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18654
	    if (__bothSmallInteger(maxW, maxH)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18655
		RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18656
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18657
		rec.left = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18658
		rec.top = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18659
		rec.right = __intVal(maxW);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18660
		rec.bottom = __intVal(maxH);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18661
#ifdef ADJUSTWINDOW
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18662
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18663
#endif
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18664
		lI->maxWidth = rec.right - rec.left;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18665
		lI->maxHeight = rec.bottom - rec.top;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18666
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18667
	}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18668
    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18669
%}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18670
!
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18671
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18672
setWindowName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18673
    "define a windows name"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18674
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18675
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18676
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18677
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18678
	HWND win = _HWNDVal(aWindowId);
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18679
	wchar_t nameBuffer[ MAX_LABEL_SIZE ];
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18680
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 18681
	if (__isStringLike(aString)) {
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18682
	    ch2wch((char *)__stringVal(aString), nameBuffer, MAX_LABEL_SIZE);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18683
	    SetWindowTextW(win, nameBuffer);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18684
	    RETURN (self);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18685
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18686
	if (__isUnicode16String(aString)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18687
	    int l = __unicode16StringSize(aString);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18688
	    if (l >= MAX_LABEL_SIZE) l = MAX_LABEL_SIZE-1;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18689
	    memmove(nameBuffer, __unicode16StringVal(aString), l*sizeof(wchar_t));
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18690
	    nameBuffer[ l ] = 0;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18691
	    SetWindowTextW(win, nameBuffer);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18692
	    RETURN (self);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18693
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18694
    }
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18695
%}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18696
    "
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18697
     (StandardSystemView new label:'äöü') open
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18698
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18699
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18700
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18701
setWindowShapeEllipticalX:x Y:y width:w height:h in:aWindowId
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18702
    "set the windows shape to an elliptical region"
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18703
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18704
%{
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18705
    if (__isExternalAddress(aWindowId)
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18706
     && __bothSmallInteger(x, y)
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18707
     && __bothSmallInteger(w, h)) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18708
	HWND win = _HWNDVal(aWindowId);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18709
	int left = __intVal(x);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18710
	int top = __intVal(y);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18711
	int right = left + __intVal(w);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18712
	int bottom = top + __intVal(h);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18713
	HRGN rgn;
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18714
	HDC winDC;
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18715
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18716
	rgn = CreateEllipticRgn(left, top, right, bottom);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18717
	if (rgn) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18718
	    winDC = GetDCEx(win, 0, DCX_WINDOW);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18719
	    if (winDC) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 18720
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 18721
		GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 18722
#endif
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18723
		if (SelectClipRgn(winDC, rgn) == ERROR ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 18724
		    console_fprintf(stderr, "select clipping region failed\n");
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18725
		}
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18726
		ReleaseDC(win, winDC);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18727
	    }
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18728
	    else
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 18729
		console_fprintf(stderr, "getDC failed\n");
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18730
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18731
	    _DeleteObject(rgn, __LINE__);
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18732
	}
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18733
	else
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 18734
	    console_fprintf(stderr, "region creation failed\n");
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18735
	RETURN ( self );
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18736
    }
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18737
%}.
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18738
    self primitiveFailed
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18739
!
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18740
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18741
topWindowIdsDo:aBlock
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18742
    |l|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18743
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18744
    l := OrderedCollection new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18745
    self primEnumWindowsInto:l.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18746
    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
 18747
	(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
 18748
	    "/ a topView
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18749
	    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
 18750
	]
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18751
    ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18752
    ^ nil
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18753
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18754
    "
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18755
     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
 18756
	|nm|
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18757
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18758
	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
 18759
	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
 18760
	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
 18761
	Transcript showCR:nm.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18762
     ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18763
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18764
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18765
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18766
     |w|
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18767
     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
 18768
	|nm|
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18769
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18770
	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
 18771
	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
 18772
	(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
 18773
	    w := id.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18774
	]
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18775
     ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18776
     Display resizeWindow:w width:1024 height:1024
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18777
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18778
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18779
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18780
unmapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18781
    "make a window invisible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18782
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18783
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18784
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18785
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18786
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18787
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18788
	if (win) {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 18789
	    CPRINTF(("unmapWindow %x\n",win));
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 18790
	    SetWindow_unmapping(win, 1);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18791
	    ShowWindowAsync(win, SW_HIDE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18792
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18793
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18794
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18795
%}
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18796
!
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18797
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18798
unmapWindow:aWindowId animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18799
    "make a window invisible with some animation effect."
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18800
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18801
    self animateWindow:aWindowId show:false animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18802
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18803
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18804
windowIsIconified:aWindowId
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18805
    "return true, if some window is iconified."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18806
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18807
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18808
    if (__isExternalAddress(aWindowId)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18809
	HWND win = _HWNDVal(aWindowId);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18810
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18811
	if (win) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18812
	    if (GetWindow_iconified(win)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18813
		RETURN (true);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18814
	    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18815
	}
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18816
    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18817
%}.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18818
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18819
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18820
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18821
!WinWorkstation methodsFor:'window stuff-native'!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18822
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18823
enableScrollBar:howSymbol in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18824
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18825
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18826
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18827
    if (__isExternalAddress(aWindowId)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18828
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18829
	int how;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18830
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18831
	if (howSymbol == @symbol(ENABLE_BOTH)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18832
	    how = ESB_ENABLE_BOTH;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18833
	} else if (howSymbol == @symbol(DISABLE_LTUP)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18834
	    how = ESB_DISABLE_LTUP;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18835
	} else if (howSymbol == @symbol(DISABLE_RTDN)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18836
	    how = ESB_DISABLE_RTDN;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18837
	} else if (howSymbol == @symbol(DISABLE_BOTH)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18838
	    how = ESB_DISABLE_BOTH;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18839
	} else {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18840
	    RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18841
	}
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18842
	NDPRINTF(("EnableScrollBar(%d)\n", how));
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18843
	EnableScrollBar(win, SB_CTL, how);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18844
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18845
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18846
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18847
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18848
!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18849
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18850
setScrollBarPageSize:sz redraw:redraw in:aWindowId
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18851
    "native scrollBar widget access"
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18852
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18853
%{
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18854
    if (__isExternalAddress(aWindowId)
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18855
     && __isSmallInteger(sz)) {
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18856
	HWND win = _HWNDVal(aWindowId);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18857
	SCROLLINFO info;
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18858
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18859
	info.cbSize = sizeof(SCROLLINFO);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18860
	info.nPage = __intVal(sz);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18861
	info.fMask = SIF_PAGE;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 18862
	NDPRINTF2(("SetScrollPage(%d)\n", __intVal(sz)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18863
	SetScrollInfo(win, SB_CTL, &info, redraw==true ? 1 : 0);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18864
	RETURN ( self );
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18865
    }
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18866
%}.
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18867
    self primitiveFailed
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18868
!
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18869
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18870
setScrollPosition:newPosition redraw:redraw in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18871
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18872
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18873
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18874
    if (__isExternalAddress(aWindowId)
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18875
     && __isSmallInteger(newPosition)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18876
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18877
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 18878
	NDPRINTF2(("SetScrollPos(%d)\n", __intVal(newPosition)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18879
	SetScrollPos(win, SB_CTL, __intVal(newPosition), redraw==true ? 1 : 0);
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18880
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18881
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18882
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18883
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18884
!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18885
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18886
setScrollRange:min to:max redraw:redraw in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18887
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18888
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18889
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18890
    if (__isExternalAddress(aWindowId)
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18891
     && __bothSmallInteger(min, max)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18892
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18893
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
 18894
	NDPRINTF2(("SetScrollRange(%d..%d)\n", __intVal(min), __intVal(max)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18895
	SetScrollRange(win, SB_CTL, __intVal(min), __intVal(max), redraw==true ? 1 : 0);
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18896
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18897
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18898
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18899
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18900
! !
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18901
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18902
!WinWorkstation::AlphaBlendParameters methodsFor:'accessing'!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18903
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18904
at:index
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18905
    ^ self instVarAt:index
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18906
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18907
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18908
blueMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18909
    ^ blueMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18910
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18911
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18912
blueMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18913
    blueMask := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18914
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18915
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18916
greenMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18917
    ^ greenMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18918
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18919
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18920
greenMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18921
    greenMask := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18922
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18923
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18924
padding
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18925
    ^ padding
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18926
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18927
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18928
padding:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18929
    padding := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18930
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18931
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18932
redMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18933
    ^ redMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18934
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18935
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18936
redMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18937
    redMask := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18938
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18939
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18940
sourceAlpha
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18941
    ^ sourceAlpha
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18942
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18943
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18944
sourceAlpha:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18945
    sourceAlpha := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18946
! !
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18947
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18948
!WinWorkstation::CopyDataStructStructure class methodsFor:'accessing'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18949
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18950
sizeInBytes
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18951
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18952
    ^ 12
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18953
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18954
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18955
!WinWorkstation::CopyDataStructStructure class methodsFor:'instance creation'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18956
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18957
new
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18958
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18959
    ^super new: self sizeInBytes
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18960
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18961
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18962
!WinWorkstation::CopyDataStructStructure methodsFor:'accessing'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18963
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18964
cbData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18965
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18966
    ^ self doubleWordAt: 4 + 1
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18967
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18968
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18969
cbData: cbData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18970
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18971
    ^ self doubleWordAt: 4 + 1 put: cbData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18972
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18973
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18974
dwData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18975
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18976
    ^ self doubleWordAt: 0 + 1
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18977
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18978
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18979
dwData: dwData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18980
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18981
    ^ self doubleWordAt: 0 + 1 put: dwData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18982
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18983
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18984
lpData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18985
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18986
    ^ self doubleWordAt: 8 + 1
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18987
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18988
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18989
lpData: lpData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18990
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18991
    ^ self doubleWordAt: 8 + 1 put: lpData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18992
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18993
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18994
!WinWorkstation::MonitorInfo methodsFor:'accessing'!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18995
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 18996
bounds
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 18997
     "return a rectangle representing the displays bounding box of the monitor"
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 18998
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 18999
"/ ******* MULTI SCREEN ******
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19000
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19001
    ^ Rectangle
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19002
	left:screenX
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19003
	top:screenY
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19004
	width:workW - 1
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19005
	height:workH - 1
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19006
!
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19007
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19008
isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19009
    ^ isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19010
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19011
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19012
name
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19013
    ^ name
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19014
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19015
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19016
screenHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19017
    ^ screenH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19018
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19019
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19020
screenWidth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19021
    ^ screenW
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19022
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19023
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19024
screenX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19025
    ^ screenX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19026
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19027
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 19028
screenX:screenXArg screenY:screenYArg screenWidth:screenWArg screenHeight:screenHArg
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 19029
    workX:workXArg workY:workYArg workWidth:workWArg workHeight:workHArg
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 19030
    isPrimary:isPrimaryArg name:nameArg
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19031
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19032
    screenX := screenXArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19033
    screenY := screenYArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19034
    screenW := screenWArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19035
    screenH := screenHArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19036
    workX := workXArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19037
    workY := workYArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19038
    workW := workWArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19039
    workH := workHArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19040
    isPrimary := isPrimaryArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19041
    name := nameArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19042
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19043
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19044
screenY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19045
    ^ screenY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19046
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19047
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19048
workHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19049
    ^ workH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19050
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19051
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19052
workWidth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19053
    ^ workW
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19054
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19055
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19056
workX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19057
    ^ workX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19058
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19059
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19060
workY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19061
    ^ workY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19062
! !
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19063
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19064
!WinWorkstation::PrinterDeviceContextHandle class methodsFor:'documentation'!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19065
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19066
documentation
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19067
"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19068
    This is used as a finalization handle for printer contexts
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19069
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19070
    [see also:]
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19071
	DeviceHandle
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19072
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19073
    [author:]
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19074
	Claus Gittinger
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19075
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19076
"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19077
! !
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19078
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19079
!WinWorkstation::PrinterDeviceContextHandle methodsFor:'finalization'!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19080
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19081
finalize
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19082
    "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
 19083
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19084
    |id|
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19085
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19086
    (id := gcId) notNil ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19087
	gcId := nil.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19088
	device destroyPrinterDC:id.
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19089
    ]
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19090
! !
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19091
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19092
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19093
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19094
version
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 19095
    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.465 2012-11-22 12:38:39 ab Exp $'
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 19096
!
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 19097
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 19098
version_CVS
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 19099
    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.465 2012-11-22 12:38:39 ab Exp $'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19100
! !
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 19101
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19102
WinWorkstation initialize!