WinWorkstation.st
author Claus Gittinger <cg@exept.de>
Wed, 12 Aug 1998 13:22:55 +0200
changeset 2239 f535b1178597
parent 2238 e04ff81bb3d9
child 2240 bc95654feffb
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     1
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     2
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     3
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     5
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     6
 only in accordance with the terms of that license and with the
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     9
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    10
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    11
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    12
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    13
'From Smalltalk/X, Version:3.4.8 on 23-jul-1998 at 12:28:43'                    !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    14
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    15
DeviceWorkstation subclass:#WinWorkstation
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    16
	instanceVariableNames:'blackpixel whitepixel listOfFonts rootWin rootDC buttonsPressed
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    17
		eventTrace eventBuffer usingSystemPalette inRecursiveDispatch
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    18
		dispatchingExpose'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    19
	classVariableNames:'BeepFrequency BeepDuration NativeWindows NativeWindowClassTable
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    20
		StandardColorValues'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    21
	poolDictionaries:''
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    22
	category:'Interface-Graphics'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    23
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    24
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    25
!WinWorkstation primitiveDefinitions!
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    26
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    27
#define COUNT_RESOURCES 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    28
#define COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    29
#define ADJUSTWINDOW
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    30
#define ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    31
#define WIN32THREADS
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    32
/*#define DEBUGMASK*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    33
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    34
# undef INT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    35
# define INT WIN_INT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    36
# undef Array
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    37
# define Array WIN_Array
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    38
# undef Number
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    39
# define Number WIN_Number
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    40
# undef Method
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    41
# define Method WIN_Method
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    42
# undef Point
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    43
# define Point WIN_Point
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    44
# undef Rectangle
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
    45
/*# define Rectangle WIN_Rectangle*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    46
# undef True
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    47
# define True WIN_True
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    48
# undef False
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    49
# define False WIN_False
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    50
# undef Block
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
    51
# define Block WIN_Block
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
    52
# undef Context
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
    53
# define Context WIN_Context
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    54
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    55
# undef xxCONTEXT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    56
# define xxCONTEXT        WIN_CONTEXT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    57
# undef _xxCONTEXT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    58
# define _xxCONTEXT       _WIN_CONTEXT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    59
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    60
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    61
/* #include <stdio.h> */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    62
/* #include <malloc.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    63
/* #include <math.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    64
/* #include <string.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    65
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    66
/*#include <stdarg.h>   */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    67
#ifdef __BORLANDC__
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    68
#define NOATOM
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    69
#define NOGDICAPMASKS
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    70
#define NOMETAFILE
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    71
#define NOMINMAX
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    72
#define NOOPENFILE
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    73
#define NOSOUND
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    74
#define NOWH
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    75
#define NOCOMM
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    76
#define NOKANJI
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    77
#define NOCRYPT
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    78
#define NOMCX
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    79
#define WIN32_LEAN_AND_MEAN
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    80
#include <windows.h>
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    81
#include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    82
#else
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    83
#define _USERENTRY /**/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    84
#define NOATOM
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    85
#define NOGDICAPMASKS
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    86
#define NOMETAFILE
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    87
#define NOMINMAX
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    88
#define NOOPENFILE
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    89
#define NOSOUND
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    90
#define NOWH
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    91
#define NOCOMM
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    92
#define NOKANJI
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    93
#define NOCRYPT
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    94
#define NOMCX
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    95
#define WIN32_LEAN_AND_MEAN
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    96
#include <windows.h>
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    97
#include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    98
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    99
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   100
#include <process.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   101
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   102
#   ifdef __DEF_Array
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   103
#    undef Array
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   104
#    define Array __DEF_Array
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   105
#   endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   106
#   ifdef __DEF_Number
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   107
#    undef Number
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   108
#    define Number __DEF_Number
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   109
#   endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   110
#   ifdef __DEF_Method
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   111
#    undef Method
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   112
#    define Method __DEF_Method
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   113
#   endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   114
#   ifdef __DEF_Point
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   115
#    undef Point
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   116
#    define Point __DEF_Point
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   117
#   endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   118
#   ifdef __DEF_Block
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   119
#    undef Block
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   120
#    define Block __DEF_Block
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   121
#   endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   122
#   ifdef __DEF_Context
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   123
#    undef Context
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   124
#    define Context __DEF_Context
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   125
#   endif
1912
f92a2ff8ffc4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   126
#   undef INT
f92a2ff8ffc4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   127
#   define INT int
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   128
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   129
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   130
 * some defines - tired of typing ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   131
 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   132
#define _HANDLEVal(o)        (HANDLE)(__MKCP(o))
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   133
#define _HBITMAPVAL(o)       (HBITMAP)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   134
#define _HWNDVal(o)          (HWND)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   135
#define _HPALETTEVal(o)      (HPALETTE)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   136
#define _HCURSORVal(o)       (HCURSOR)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   137
#define _HGDIOBJVal(o)       (HGDIOBJ)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   138
#define _LOGPALETTEVal(o)    (LOGPALETTE *)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   139
#define _COLORREFVal(o)      (COLORREF)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   140
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   141
#define _GCDATA(o)           ((struct gcData *)(__MKCP(o)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   142
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   143
#define __rootDC             (HDC)(__MKCP(__INST(rootDC)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   144
#define ISCONNECTED          (__INST(rootDC) != nil)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   145
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   146
struct gcData {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   147
    HWND        hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   148
    HBITMAP     hBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   149
    HBITMAP     savehBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   150
    int         clipping;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   151
    int         clipX;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   152
    int         clipY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   153
    int         clipW;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   154
    int         clipH;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   155
    int         clipByChild;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   156
    HDC         _hDC;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   157
    HBITMAP     hMask;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   158
    int         bitmapColorBitCount;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   159
    int         lineWidth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   160
    int         lineStyle;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   161
    int         joinStyle;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   162
    int         capStyle;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   163
    int         fontAscent;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   164
    int         rop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   165
    int         bitbltrop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   166
    COLORREF    fgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   167
    COLORREF    bgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   168
    HFONT       hFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   169
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   170
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   171
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   172
 * some synthetic values
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   173
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   174
/*****************************************************************
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   175
 * EVENT DEFINITIONS
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   176
 *****************************************************************/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   177
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   178
/* 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
   179
   to Grab requests.  Not to be confused with event names.  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   180
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   181
#define NoEventMask                     0L
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   182
#define KeyPressMask                    (1L<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   183
#define KeyReleaseMask                  (1L<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   184
#define ButtonPressMask                 (1L<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   185
#define ButtonReleaseMask               (1L<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   186
#define EnterWindowMask                 (1L<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   187
#define LeaveWindowMask                 (1L<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   188
#define PointerMotionMask               (1L<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   189
#define PointerMotionHintMask           (1L<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   190
#define Button1MotionMask               (1L<<8)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   191
#define Button2MotionMask               (1L<<9)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   192
#define Button3MotionMask               (1L<<10)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   193
#define Button4MotionMask               (1L<<11)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   194
#define Button5MotionMask               (1L<<12)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   195
#define ButtonMotionMask                (1L<<13)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   196
#define KeymapStateMask                 (1L<<14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   197
#define ExposureMask                    (1L<<15)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   198
#define VisibilityChangeMask            (1L<<16)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   199
#define StructureNotifyMask             (1L<<17)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   200
#define ResizeRedirectMask              (1L<<18)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   201
#define SubstructureNotifyMask          (1L<<19)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   202
#define SubstructureRedirectMask        (1L<<20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   203
#define FocusChangeMask                 (1L<<21)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   204
#define PropertyChangeMask              (1L<<22)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   205
#define ColormapChangeMask              (1L<<23)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   206
#define OwnerGrabButtonMask             (1L<<24)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   207
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   208
/* 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
   209
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
   210
are reserved in the protocol for errors and replies. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   211
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   212
#define KeyPress                2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   213
#define KeyRelease              3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   214
#define ButtonPress             4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   215
#define ButtonRelease           5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   216
#define MotionNotify            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   217
#define EnterNotify             7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   218
#define LeaveNotify             8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   219
#define FocusIn                 9
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   220
#define FocusOut                10
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   221
#define KeymapNotify            11
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   222
#define Expose                  12
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   223
#define GraphicsExpose          13
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   224
#define NoExpose                14
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   225
#define VisibilityNotify        15
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   226
#define CreateNotify            16
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   227
#define DestroyNotify           17
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   228
#define UnmapNotify             18
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   229
#define MapNotify               19
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   230
#define MapRequest              20
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   231
#define ReparentNotify          21
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   232
#define ConfigureNotify         22
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   233
#define ConfigureRequest        23
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   234
#define GravityNotify           24
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   235
#define ResizeRequest           25
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   236
#define CirculateNotify         26
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   237
#define CirculateRequest        27
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   238
#define PropertyNotify          28
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   239
#define SelectionClear          29
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   240
#define SelectionRequest        30
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   241
#define SelectionNotify         31
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   242
#define ColormapNotify          32
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   243
#define ClientMessage           33
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   244
#define MappingNotify           34
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   245
#define LASTEvent               35      /* must be bigger than any event # */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   246
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   247
/*# define Button1MotionMask      1
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   248
# define Button2MotionMask      2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   249
# define Button3MotionMask      4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   250
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   251
# define Button1Mask            Button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   252
# define Button2Mask            Button2MotionMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   253
# define Button3Mask            Button3MotionMask*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   254
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   255
/* 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
   256
   state in various key-, mouse-, and button-related events. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   257
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   258
#define ShiftMask               (1<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   259
#define LockMask                (1<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   260
#define ControlMask             (1<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   261
#define Mod1Mask                (1<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   262
#define Mod2Mask                (1<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   263
#define Mod3Mask                (1<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   264
#define Mod4Mask                (1<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   265
#define Mod5Mask                (1<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   266
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   267
/* modifier names.  Used to build a SetModifierMapping request or
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   268
   to read a GetModifierMapping request.  These correspond to the
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   269
   masks defined above. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   270
#define ShiftMapIndex           0
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   271
#define LockMapIndex            1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   272
#define ControlMapIndex         2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   273
#define Mod1MapIndex            3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   274
#define Mod2MapIndex            4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   275
#define Mod3MapIndex            5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   276
#define Mod4MapIndex            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   277
#define Mod5MapIndex            7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   278
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   279
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   280
/* 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
   281
   with button names below. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   282
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   283
# define Button1Mask            Button1MotionMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   284
# define Button2Mask            Button2MotionMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   285
# define Button3Mask            Button3MotionMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   286
# define Button4Mask            Button4MotionMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   287
# define Button5Mask            Button5MotionMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   288
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   289
#define AnyModifier             (1<<15)  /* used in GrabButton, GrabKey */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   290
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   291
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   292
/* 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
   293
   and ButtonRelease events.  Not to be confused with button masks above.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   294
   Note that 0 is already defined above as "AnyButton".  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   295
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   296
#define Button1                 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   297
#define Button2                 2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   298
#define Button3                 3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   299
#define Button4                 4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   300
#define Button5                 5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   301
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   302
/*# define ControlMask            8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   303
# define ShiftMask              16*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   304
# define LeftAltMask            Mod1Mask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   305
# define RightAltMask           Mod2Mask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   306
# define TRANSLATED_KEY         Mod5Mask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   307
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   308
#define WIN32PADDING 32
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   309
/*
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   310
 * synthetic events
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   311
 */
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   312
#define __WM_MOUSEENTER        0x10001
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   313
#define __WM_MOUSELEAVE        0x10002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   314
#define __WM_GEXPOSE           0x10003
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   315
#define __WM_NOGEXPOSE         0x10004
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   316
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   317
static int AltMask = RightAltMask;
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   318
static int MetaMask = LeftAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   319
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   320
# define WhitePixel     RGB(0xFF, 0xFF, 0xFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   321
# define BlackPixel     RGB(0, 0, 0)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   322
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   323
/*#undef DEBUG*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   324
#ifdef DEBUG
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   325
# define PRINTF(x)              { printf x;}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   326
# define CPRINTF(x)              { if (__debug__) printf x;}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   327
# define RESPRINTF(x)           { if (__debug__) printf x;}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   328
# define RES1PRINTF(x)          { if (__debug__) printf x;}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   329
# define RES_BMP_PRINTF(x)      { if (__debug__) printf x;}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   330
# define TH_DPRINTF(x)          /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   331
# define POSTPRINTF(x)          { if (__debug__) printf x;}
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   332
# define DPRINTF(x)             { if (__debug__) printf x;}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   333
# define DDPRINTF(x)            /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   334
# define EVENT_PRINTF(x)        /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   335
# define EVENT_PRINTF2(x)       /*{ if (__debug__) printf x;}*/
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   336
# define EVENT_PRINTF3(x)       /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   337
#else
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   338
# define PRINTF(x)             /* */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   339
# define CPRINTF(x)             /* */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   340
# define RES_BMP_PRINTF(x)     /**/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   341
# define RESPRINTF(x)             /* */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   342
# define RES1PRINTF(x)             /* */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   343
# define TH_DPRINTF(x)          /* */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   344
# define POSTDPRINTF(x)          /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   345
# define DPRINTF(x)             /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   346
# define DDPRINTF(x)            /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   347
# define EVENT_PRINTF(x)        /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   348
# define EVENT_PRINTF2(x)       /* */
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   349
# define EVENT_PRINTF3(x)       /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   350
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   351
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   352
# define BR_SOLID       0
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   353
# define BR_PATTERN     1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   354
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   355
# define LINE_SOLID     0
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   356
# define LINE_DASH      1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   357
# define LINE_DDASH     2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   358
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   359
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   360
# define _C_ARROW       1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   361
# define _C_CROSS       2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   362
# define _C_IBEAM       3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   363
# define _C_ICON        4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   364
# define _C_NO          5
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   365
# define _C_SIZE        6
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   366
# define _C_SIZEALL     7
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   367
# define _C_SIZENESW    8
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   368
# define _C_SIZENS      9
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   369
# define _C_SIZENWSE    10
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   370
# define _C_UPARROW     11
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   371
# define _C_WAIT        12
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   372
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   373
 static HCURSOR H_C_ARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   374
 static HCURSOR H_C_CROSS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   375
 static HCURSOR H_C_IBEAM = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   376
 static HCURSOR H_C_ICON = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   377
 static HCURSOR H_C_NO = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   378
 static HCURSOR H_C_SIZE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   379
 static HCURSOR H_C_SIZEALL = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   380
 static HCURSOR H_C_SIZENESW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   381
 static HCURSOR H_C_SIZENS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   382
 static HCURSOR H_C_SIZENWSE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   383
 static HCURSOR H_C_UPARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   384
 static HCURSOR H_C_WAIT = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   385
#endif /* KEEP_STD_CURSORS */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   386
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   387
static int c_count;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   388
static int evRootX, evRootY;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   389
static int multiClickState;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   390
static UINT lastMSGTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   391
static UINT multiClickTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   392
static UINT nextMultiClickTime;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   393
static int destroyWin;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   394
static int __modifiers;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   395
static HDC tmpDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   396
static int __isWinNT;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   397
static int __logPixelSY;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   398
#define WM_THREADCREATEWINDOW   WM_USER + 0x101
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   399
#define WM_THREADDESTROYWINDOW  WM_USER + 0x102
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   400
#define WM_THREADSETFOCUS       WM_USER + 0x103
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   401
#define WM_THREADSETCAPTURE     WM_USER + 0x104
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   402
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   403
#define THREADINPUTEVENTNAME "InputEvents"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   404
#define THREADEVENTNAME "CreateEvents"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   405
#define THREADMUTEXNAME "MutexToProtectEvents"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   406
#define isInputEvent() ((int)eventQueueHead)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   407
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   408
typedef int (*intf)(int);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   409
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   410
/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   411
 * 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
   412
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   413
#define LI_TOPWIN       0x0001
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   414
#define LI_INPUTWIN     0x0002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   415
typedef struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   416
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   417
	HCURSOR hCursor;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   418
	int  bgBrush;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   419
	int flag;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   420
	int minWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   421
	int maxWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   422
	int minHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   423
	int maxHeight;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   424
	int eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   425
} localWindowInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   426
typedef localWindowInfo *plocalWindowInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   427
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   428
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   429
#define GETLOCALWINDOWINFOPTR(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   430
	((localWindowInfo*)GetWindowLong(__hWnd__, 0))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   431
#define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   432
	SetWindowLong(__hWnd__, 0 , (DWORD)__ptr__)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   433
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   434
#define SetWindow_Cursor(__hWnd__, __hCurs__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   435
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   436
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   437
#define GetWindow_Cursor(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   438
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   439
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   440
#define SetWindow_bgBrush(__hWnd__, __bgBrush__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   441
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bgBrush = __bgBrush__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   442
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   443
#define GetWindow_bgBrush(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   444
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bgBrush : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   445
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   446
#define GetWindow_paintInfoPtr(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   447
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   448
#define GetWindow_sizeInfoPtr(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   449
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->sizeInfo) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   450
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   451
#define SetWindow_Flag(__hWnd__, __flag__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   452
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   453
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   454
#define GetWindow_Flag(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   455
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   456
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   457
#define GetWindow_eventMask(__hWnd__) \
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   458
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   459
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   460
struct queuedEvent {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   461
	struct queuedEvent     *ev_next;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   462
	int                     count;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   463
	int                     ev_flag;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   464
	HWND                    ev_hWnd;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   465
	UINT                    ev_message;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   466
	UINT                    ev_wParam;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   467
	int                     ev_arg1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   468
	int                     ev_arg2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   469
	int                     ev_arg3;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   470
	int                     ev_arg4;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   471
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   472
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   473
#define ev_x    ev_arg1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   474
#define ev_y    ev_arg2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   475
#define ev_w    ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   476
#define ev_h    ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   477
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   478
#define ev_keyCode   ev_wParam
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   479
#define ev_scanCode  ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   480
#define ev_modifiers ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   481
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   482
#define EV_CHUNK_CNT    10000
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   483
#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
   484
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   485
#define BITBLT_COPY             SRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   486
#define BITBLT_COPYINVERTED     NOTSRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   487
#define BITBLT_XOR              SRCINVERT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   488
#define BITBLT_AND              SRCAND
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   489
#define BITBLT_OR               SRCPAINT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   490
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   491
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   492
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   493
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   494
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   495
!WinWorkstation primitiveVariables!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   496
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   497
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   498
static int firstInstance = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   499
static char *app_name = "ST/X";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   500
static char *app_nameroot = "ST/X:Root";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   501
static int __debug__ = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   502
static int __depth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   503
static HWND __rootWin = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   504
static HWND __rootWinSpezial = NULL;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   505
static HDESK __rootDesk;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   506
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   507
#define CAPTURE_NONE     0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   508
#define CAPTURE_EXPLICIT 1
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   509
#define CAPTURE_IMPLICIT 2
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   510
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   511
static int currentCapture = CAPTURE_NONE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   512
static int lastNCMouseX, lastNCMouseY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   513
static int lastMoveX, lastMoveY, lastSizeWidth, lastSizeHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   514
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   515
static HANDLE currentPointerView = (HANDLE)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   516
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   517
/* MessageDispatchThread */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   518
static char *_thread_windowName;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   519
static char *_thread_className;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   520
static int _thread_winStyleBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   521
static int _thread_winStyleBitsEx;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   522
static HANDLE _thread_parentHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   523
static int _thread_x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   524
static int _thread_y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   525
static int _thread_dx;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   526
static int _thread_dy;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   527
static localWindowInfo *_thread_local;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   528
static HANDLE _thread_newWinHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   529
static DWORD _masterThreadId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   530
static HANDLE _masterThread;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   531
static DWORD _dispatchThreadId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   532
static BOOL bdispatchThreadState;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   533
static int lockcount;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   534
static HANDLE hdispatchMutex;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   535
static HANDLE hCreateEvent;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   536
static HANDLE hInputEvent;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   537
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   538
static int __cnt_bmpdc;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   539
static int __cnt_gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   540
static int __cnt_createWindows;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   541
static int __cnt_bitmap;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   542
static int __cnt_cur;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   543
static int __cnt_font;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   544
struct queuedEvent *eventFreeList = (struct queuedEvent *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   545
struct queuedEvent *eventQueueHead = (struct queuedEvent *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   546
struct queuedEvent *eventQueueTail = (struct queuedEvent *)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   547
static int eventsendcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   548
static int eventempfcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   549
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   550
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   551
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   552
!WinWorkstation primitiveFunctions!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   553
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   554
#ifdef WIN32THREADS
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   555
extern void __suspendAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   556
extern void __resumeAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   557
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   558
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   559
__debugEvent__() {}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   560
#ifdef DEBUGMASK
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   561
printMask(int mask)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   562
{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   563
    if (mask & KeyPressMask)        printf("KeyPressMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   564
    if (mask & KeyReleaseMask)      printf("KeyReleaseMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   565
    if (mask & ButtonPressMask)     printf("ButtonPressMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   566
    if (mask & ButtonReleaseMask)   printf("ButtonReleaseMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   567
    if (mask & ButtonMotionMask)    printf("ButtonMotionMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   568
    if (mask & PointerMotionMask)   printf("PointerMotionMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   569
    if (mask & ExposureMask)        printf("ExposureMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   570
    if (mask & FocusChangeMask)     printf("FocusChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   571
    if (mask & EnterWindowMask)     printf("EnterWindowMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   572
    if (mask & LeaveWindowMask)     printf("LeaveWindowMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   573
    if (mask & KeymapStateMask)     printf("KeymapStateMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   574
    if (mask & VisibilityChangeMask)printf("VisibilityChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   575
    if (mask & StructureNotifyMask) printf("StructureNotifyMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   576
    if (mask & ResizeRedirectMask)  printf("ResizeRedirectMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   577
    if (mask & PropertyChangeMask)  printf("PropertyChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   578
    if (mask & ColormapChangeMask)  printf("ColormapChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   579
}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   580
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   581
static int st2RGB(int color,struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   582
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   583
  int ir,ig,ib;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   584
  if (gcData)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   585
  {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   586
    if (gcData->bitmapColorBitCount == 1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   587
    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   588
      if (color)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   589
	return WhitePixel;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   590
      else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   591
	return BlackPixel;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   592
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   593
  }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   594
  if (__depth < 15)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   595
  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   596
    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   597
  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   598
  else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   599
  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   600
    if ((__depth == 16) || (__depth == 15))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   601
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   602
      ib = (color & 0x1f) << 3;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   603
      ig = ((color >> 5) & 0x3f) << 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   604
      ir = ((color >> 11) & 0x1f) << 3;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   605
      ir |= 7;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   606
      ig |= 3;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   607
      ib |= 7;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   608
      return RGB(ir,ig,ib);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   609
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   610
    return color;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   611
  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   612
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   613
static int RGB2st(int r,int g,int b)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   614
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   615
  int ir,ig,ib,id;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   616
  if (__depth < 15)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   617
  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   618
    id = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   619
  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   620
  else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   621
  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   622
    if ((__depth == 16) || (__depth == 15))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   623
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   624
      ir = (r >> 11) & 0x1f;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   625
      ig = (g >> 10) & 0x3f;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   626
      ib = (b >> 11) & 0x1f;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   627
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   628
      id = ( ir << 11 ) | ( ig << 5 ) | ib;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   629
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   630
    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   631
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   632
      ir = (r >> 8) & 0xff;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   633
      ig = (g >> 8) & 0xff;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   634
      ib = (b >> 8) & 0xff;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   635
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   636
      id = RGB( ir, ig, ib);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   637
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   638
  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   639
  return id;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   640
}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   641
static int DelObject(HANDLE o)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   642
{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   643
    int r = DeleteObject(o);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   644
    if (r == 0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   645
      printf("ERROR in DelObjectect\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   646
    return r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   647
}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   648
static struct gcData *newGcData()
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   649
{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   650
    struct gcData *gcData = (struct gcData *)malloc(sizeof(struct gcData));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   651
    if (! gcData) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   652
	return 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   653
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   654
    memset(gcData,0,sizeof(struct gcData));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   655
    gcData->bgColor = 0xffffff;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   656
    gcData->clipping = FALSE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   657
    gcData->clipByChild = TRUE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   658
    gcData->bitbltrop2 = BITBLT_COPY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   659
    gcData->lineWidth = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   660
    gcData->lineStyle = PS_SOLID;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   661
    gcData->joinStyle = PS_JOIN_MITER;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   662
    gcData->capStyle = PS_ENDCAP_FLAT;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   663
    return gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   664
}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   665
static HDC _getDC(struct gcData *gcData)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   666
{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   667
  if (gcData->hWnd != 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   668
  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   669
    if (__isWinNT && (gcData->hWnd == __rootWin))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   670
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   671
	gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_WINDOW);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   672
	//gcData->_hDC = GetDC(gcData->hWnd);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   673
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   674
    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   675
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   676
      if (gcData->clipByChild)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   677
      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   678
	//gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_CLIPCHILDREN);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   679
	gcData->_hDC = GetDC(gcData->hWnd);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   680
      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   681
      else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   682
	gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_PARENTCLIP);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   683
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   684
  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   685
  else if (gcData->hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   686
  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   687
    gcData->_hDC = CreateCompatibleDC(tmpDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   688
    gcData->savehBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   689
  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   690
  if (gcData->_hDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   691
  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   692
    SetTextColor(gcData->_hDC, gcData->bgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   693
    SetBkColor(gcData->_hDC, gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   694
    if (gcData->rop2)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   695
      SetROP2(gcData->_hDC, gcData->rop2);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   696
    if (gcData->clipping)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   697
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   698
	HRGN  region = CreateRectRgn( gcData->clipX,gcData->clipY,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   699
				gcData->clipX + gcData->clipW,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   700
				gcData->clipY + gcData->clipH );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   701
	if( region == NULL ) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   702
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   703
	    DPRINTF((" clipping region creation failed!\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   704
	} 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   705
	else 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   706
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   707
	    if (SelectClipRgn(gcData->_hDC, region) == ERROR )
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   708
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   709
		DPRINTF((" clipping region release unsuccessful\n" ));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   710
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   711
	    /*printf("%x c\n",hDC);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   712
	    DelObject(region);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   713
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   714
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   715
  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   716
  return gcData->_hDC;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   717
}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   718
static void _releaseDC(struct gcData *gcData)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   719
{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   720
  if (gcData->hWnd)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   721
  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   722
    if (gcData->_hDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   723
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   724
      ReleaseDC(gcData->hWnd,gcData->_hDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   725
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   726
  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   727
  else if (gcData->hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   728
  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   729
     SelectObject(gcData->_hDC,gcData->savehBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   730
     DeleteDC(gcData->_hDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   731
  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   732
  gcData->_hDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   733
}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   734
static HBRUSH GcDataGetBrush(HDC hDC,struct gcData *gcData)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   735
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   736
    HBRUSH hBrush = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   737
    if (gcData->hMask)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   738
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   739
      hBrush = CreatePatternBrush(gcData->hMask);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   740
      RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   741
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   742
    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   743
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   744
      hBrush = CreateSolidBrush(gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   745
      RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   746
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   747
    return hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   748
}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   749
static HPEN GcDataGetPen(HDC hDC,struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   750
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   751
    HPEN hPen = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   752
    LOGBRUSH Brush;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   753
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   754
    if (gcData->hMask)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   755
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   756
      Brush.lbStyle = BS_PATTERN;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   757
      Brush.lbHatch = (DWORD)gcData->hMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   758
      Brush.lbColor = gcData->fgColor;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   759
      hPen = ExtCreatePen(PS_GEOMETRIC | gcData->capStyle | gcData->joinStyle | gcData->lineStyle,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   760
			  gcData->lineWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   761
			  &Brush,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   762
			  0,0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   763
      RESPRINTF(("ExtCreatePen %s %d %x %x\n",(gcData->lineStyle == PS_SOLID) ? "SOLID " : "DASHED",
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   764
				      gcData->lineWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   765
				      gcData->fgColor,gcData->hMask));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   766
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   767
    if (!hPen)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   768
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   769
      if (gcData->lineStyle == PS_SOLID)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   770
	hPen = CreatePen(gcData->lineStyle,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   771
		       gcData->lineWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   772
		       gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   773
      else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   774
	hPen = CreatePen(PS_DOT,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   775
		       0,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   776
		       0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   777
      RESPRINTF(("CreatePen %s %d %x\n",(gcData->lineStyle == PS_SOLID) ? "SOLID " : "DASHED",
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   778
				      gcData->lineWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   779
				      gcData->fgColor));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   780
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   781
    return hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   782
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   783
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   784
static
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   785
int lockEvent()
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   786
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   787
    DWORD dwWaitResult;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   788
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   789
    /* Request ownership of mutex. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   790
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   791
    dwWaitResult = WaitForSingleObject(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   792
	hdispatchMutex,   /* handle of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   793
	5000L);   /* time-out interval */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   794
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   795
    lockcount++;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   796
    if (lockcount != 1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   797
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   798
       printf("WINWORKSTATION:lockcount != 1 :=%d\n",lockcount);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   799
       lockcount = 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   800
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   801
    switch (dwWaitResult)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   802
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   803
	// The thread got mutex ownership.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   804
	case WAIT_OBJECT_0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   805
	    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   806
	// Cannot get mutex ownership due to time-out.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   807
	case WAIT_TIMEOUT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   808
	    printf("lockEvent fail\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   809
	    return FALSE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   810
	// Got ownership of the abandoned mutex object.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   811
	default:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   812
	    return FALSE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   813
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   814
    return TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   815
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   816
void unlockEvent()
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   817
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   818
    if (lockcount != 1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   819
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   820
       printf("lockcount != 1 :=%d\n",lockcount);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   821
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   822
    lockcount--;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   823
    /* Release ownership of the mutex object. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   824
    if (! ReleaseMutex(hdispatchMutex)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   825
      /* Deal with error. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   826
      printf("unlock Error\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   827
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   828
}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   829
static int initqueue()
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   830
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   831
    struct queuedEvent *bulk;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   832
    int i = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   833
    bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   834
    if (bulk == 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   835
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   836
      printf("no memory for dispatchqueue\n");
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   837
      return 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   838
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   839
    for (i=1; i<EV_CHUNK_CNT; i++) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   840
        bulk[i-1].ev_next = &(bulk[i]);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   841
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   842
    bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   843
    eventFreeList = bulk;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   844
    return 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   845
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   846
static
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   847
void enqEvent(int flag,HWND hWnd, UINT message, UINT wParam,int arg1,int arg2,int arg3,int arg4)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   848
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   849
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   850
    int repeatCount = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   851
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   852
    TH_DPRINTF(("TEW\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   853
    if (lockEvent())
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   854
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   855
      TH_DPRINTF(("TEF\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   856
again:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   857
      ev = eventFreeList;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   858
      if (ev) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   859
	  eventFreeList = ev->ev_next;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   860
          ev->ev_next = (struct queuedEvent *)0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   861
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   862
          ev->count = eventsendcount++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   863
          ev->ev_flag = flag;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   864
          ev->ev_hWnd = hWnd;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   865
          ev->ev_message = message;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   866
          ev->ev_wParam = wParam;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   867
          ev->ev_arg1 = arg1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   868
          ev->ev_arg2 = arg2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   869
          ev->ev_arg3 = arg3;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   870
          ev->ev_arg4 = arg4;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   871
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   872
          if (eventQueueTail) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   873
              eventQueueTail->ev_next = ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   874
          } else {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   875
              eventQueueHead = ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   876
          }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   877
          eventQueueTail = ev;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   878
      } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   879
        SetEvent(hInputEvent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   880
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   881
        unlockEvent();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   882
        if (repeatCount++ < 10)
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
          Sleep(20);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   885
          if (lockEvent())
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   886
          {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   887
             goto again;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   888
          }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   889
        }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   890
        /* throw away sorry */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   891
        return;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   892
      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   893
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   894
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   895
      SetEvent(hInputEvent);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   896
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   897
      unlockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   898
      /*SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   899
      Sleep(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   900
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   901
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   902
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   903
static
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   904
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
   905
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   906
  struct queuedEvent *ev = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   907
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   908
  if (mask != ~0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   909
  {
2236
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
   910
    CPRINTF(("deqEvent mask:%x\n",mask));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   911
  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   912
  if (hWnd)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   913
  {
2236
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
   914
    CPRINTF(("deqEvent hWnd:%x\n",hWnd));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   915
  }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   916
  if (lockEvent())
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   917
  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   918
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   919
    while (TRUE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   920
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   921
      TH_DPRINTF(("TDEQ\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   922
      ev = eventQueueHead;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   923
      if (ev)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   924
      {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   925
	eventQueueHead = ev->ev_next;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   926
	if (! eventQueueHead)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   927
	{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   928
	    eventQueueTail = (struct queuedEvent *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   929
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   930
	if (eventempfcount != ev->count)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   931
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   932
	  printf("eventcount error %d <-> %d\n",eventempfcount,ev->count);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   933
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   934
	eventempfcount++;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   935
	if (ev->ev_message == WM_DESTROY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   936
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   937
	    if (ev->ev_arg1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   938
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   939
	      if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance()))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   940
	      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   941
		/*printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   942
		free((char*)ev->ev_arg1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   943
		ev->ev_arg1 = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   944
	      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   945
	      else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   946
	      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   947
		/* noch einmal in die queue */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   948
		if (ev->ev_arg2++ < 100)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   949
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   950
		  ev->ev_next = (struct queuedEvent *)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   951
		  ev->count = eventsendcount++;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   952
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   953
		  if (eventQueueTail) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   954
		      eventQueueTail->ev_next = ev;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   955
		  } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   956
		      eventQueueHead = ev;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   957
		  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   958
		  eventQueueTail = ev;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   959
		  if (ev->ev_arg2 > 98)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   960
		  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   961
		    printf("UnregisterClass %s failed. Wait 1 sec.\n",(char*)ev->ev_arg1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   962
		    unlockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   963
		    sleep(1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   964
		    lockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   965
		  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   966
		  else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   967
		  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   968
		    unlockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   969
		    sleep(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   970
		    lockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   971
		  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   972
		  continue;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   973
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   974
		else /* fail evtl. später ändern und in st verzögert aufrufen */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   975
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   976
		  printf("UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   977
		  free((char*)ev->ev_arg1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   978
		  ev->ev_arg1 = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   979
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   980
	      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   981
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   982
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   983
	break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   984
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   985
      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   986
      else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   987
	break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   988
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   989
    if (ev)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   990
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   991
      *ret_ev = *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   992
      ev->ev_next = eventFreeList;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   993
      eventFreeList = ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   994
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   995
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   996
    unlockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   997
  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   998
    /*if (!ev)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   999
      SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_NORMAL);*/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1000
  return (ev != 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1001
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1002
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1003
static
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1004
getModifiers()
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1005
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1006
    int modifiers = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1007
    if (GetKeyState(VK_SHIFT) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1008
	modifiers |= ShiftMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1009
    if (GetKeyState(VK_CONTROL) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1010
	modifiers |= ControlMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1011
#if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1012
    if (GetKeyState(VK_RMENU) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1013
	modifiers |= RightAltMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1014
    if (GetKeyState(VK_LMENU) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1015
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1016
#else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1017
    if (GetKeyState(VK_MENU) & 0x8000)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1018
	modifiers |= LeftAltMask;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1019
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1020
    if (GetKeyState(VK_LBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1021
	modifiers |= Button1Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1022
    if (GetKeyState(VK_MBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1023
	modifiers |= Button2Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1024
    if (GetKeyState(VK_RBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1025
	modifiers |= Button3Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1026
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1027
    __modifiers = modifiers;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1028
    return modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1029
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1030
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1031
static
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1032
winEventProcessing(hWnd, message, wParam, lParam, pDefault)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1033
    HWND hWnd;                /* window handle                   */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1034
    UINT message;             /* type of message                 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1035
    UINT wParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1036
    LONG lParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1037
    int *pDefault;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1038
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1039
    LPMINMAXINFO lpmmi;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1040
    WINDOWPOS *posStruct;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1041
    RECT rct;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1042
    RECT upd;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1043
    int modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1044
    int x, y, w, h;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1045
    int isNative = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1046
    PAINTSTRUCT ps;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1047
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1048
/*
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1049
    EVENT_PRINTF(("winEvent hWin=0x%x message=0x%x wP=0x%x lP=0x%x\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1050
			hWnd, message, wParam, lParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1051
*/
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1052
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1053
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1054
    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1055
     * messages which are enqueued to be handled by the view thread
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1056
     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1057
    switch (message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1058
	case WM_CREATE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1059
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1060
	      CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1061
	      SETLOCALWINDOWINFOPTR(hWnd,lpcs->lpCreateParams);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1062
	      if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1063
		PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1064
	      *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1065
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1066
	      __cnt_createWindows++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1067
	   RESPRINTF(("CreateWindows %d\n",__cnt_createWindows));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1068
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1069
	      DPRINTF(("WM_CREATE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1070
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1071
	    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1072
	case WM_CLOSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1073
	    DPRINTF(("WM_CLOSE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1074
	    if (!destroyWin)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1075
	      enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1076
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1077
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1078
	      destroyWin = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1079
	      if (!DestroyWindow(hWnd))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1080
	      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1081
		DPRINTF(("DestroyWindow ERROR\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1082
	      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1083
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1084
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1085
	    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1086
	    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1087
	    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1088
	case WM_DESTROY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1089
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1090
	      char *n = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1091
	      DPRINTF(("WM_DESTROY\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1092
	      if (GETLOCALWINDOWINFOPTR(hWnd))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1093
	      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1094
		if (GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1095
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1096
		  n = (char*)malloc(200);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1097
		  GetClassName(hWnd,n,200);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1098
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1099
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1100
	      __cnt_createWindows--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1101
	   RESPRINTF(("DestroyWindows %d\n",__cnt_createWindows));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1102
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1103
	      /* free all resources */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1104
		/*if (GetWindow_bgBrush(hWnd))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1105
		  DelObject(GetWindow_bgBrush(hWnd));*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1106
		free(GETLOCALWINDOWINFOPTR(hWnd));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1107
		SETLOCALWINDOWINFOPTR(hWnd,0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1108
	      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1109
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1110
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1111
	      enqEvent(0,hWnd, message, wParam, (int)n, 0, 0, 0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1112
	      *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1113
	      return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1114
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1115
	    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1116
	case WM_GETMINMAXINFO:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1117
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1118
		lpmmi = (LPMINMAXINFO) lParam;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1119
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1120
		DPRINTF(("WM_GETMINMAXINFO handle=%x got min: %d/%d\n",
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1121
			    hWnd,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1122
			    lpmmi->ptMinTrackSize.x,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1123
			    lpmmi->ptMinTrackSize.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1124
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1125
		if (GETLOCALWINDOWINFOPTR(hWnd) &&
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1126
		    GETLOCALWINDOWINFOPTR(hWnd)->minWidth &&
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1127
		    GETLOCALWINDOWINFOPTR(hWnd)->maxWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1128
		   )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1129
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1130
		  lpmmi->ptMaxSize.x = GETLOCALWINDOWINFOPTR(hWnd)->maxWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1131
		  lpmmi->ptMaxSize.y = GETLOCALWINDOWINFOPTR(hWnd)->maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1132
		  lpmmi->ptMaxTrackSize.x = GETLOCALWINDOWINFOPTR(hWnd)->maxWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1133
		  lpmmi->ptMaxTrackSize.y = GETLOCALWINDOWINFOPTR(hWnd)->maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1134
		  lpmmi->ptMinTrackSize.x = GETLOCALWINDOWINFOPTR(hWnd)->minWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1135
		  lpmmi->ptMinTrackSize.y = GETLOCALWINDOWINFOPTR(hWnd)->minHeight;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1136
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1137
		  DPRINTF(("WM_GETMINMAXINFO handle=%x return min: %d/%d max: %d/%d\n",
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1138
				  hWnd,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1139
				  GETLOCALWINDOWINFOPTR(hWnd)->minWidth, GETLOCALWINDOWINFOPTR(hWnd)->minHeight,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1140
				  GETLOCALWINDOWINFOPTR(hWnd)->maxWidth, GETLOCALWINDOWINFOPTR(hWnd)->maxHeight));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1141
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1142
		*pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1143
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1144
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1145
	case WM_SETCURSOR:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1146
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1147
		HCURSOR curs;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1148
		int hitCode;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1149
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1150
		hitCode = LOWORD(lParam);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1151
		if (hitCode != HTCLIENT) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1152
		    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1153
		     * not in client area ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1154
		     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1155
		    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1156
		}
2236
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
  1157
		CPRINTF(("WM_SETCURSOR %x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1158
		curs = GetWindow_Cursor(hWnd);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1159
		if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1160
		    SetCursor(curs);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1161
		    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1162
		    return 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1163
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1164
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1165
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1166
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1167
	case WM_WINDOWPOSCHANGED:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1168
	    /*
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1169
	     * ignore child window messages ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1170
	     */
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1171
	    if (GetParent(hWnd)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1172
		break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1173
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1174
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1175
	    GetClientRect(hWnd, &rct);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1176
	    EVENT_PRINTF(("WM_WINDOWPOSCHANGED\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1177
	    enqEvent(0,hWnd, message, wParam,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1178
			       rct.left, rct.top,
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1179
			       rct.right-rct.left,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1180
			       rct.bottom-rct.top);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1181
	    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1182
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1183
	case WM_ERASEBKGND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1184
	    EVENT_PRINTF(("WM_ERASEBKGND\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1185
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1186
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1187
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1188
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1189
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1190
	    if ((GetWindow_Flag(hWnd) & LI_INPUTWIN) == 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1191
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1192
		int state;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1193
		HDC dc = (HDC)wParam;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1194
		/*HBRUSH br = GetWindow_bgBrush(hWnd);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1195
		HBRUSH br = CreateSolidBrush(st2RGB(GetWindow_bgBrush(hWnd),0));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1196
		if (br == 0)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1197
		{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1198
		  /*br = GetStockObject(LTGRAY_BRUSH);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1199
		  return 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1200
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1201
#ifdef WIN32THREADS
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1202
		__suspendAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1203
#else
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1204
		SuspendThread(_masterThread);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1205
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1206
		state = SaveDC(dc);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1207
		GetClientRect(hWnd, (LPRECT) &upd);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1208
		SelectClipRgn(dc,0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1209
		FillRect(dc, &upd, br);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1210
		/*FillRect(GetDCEx(hWnd,0,DCX_CLIPCHILDREN), &upd, br);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1211
		RestoreDC(dc,state);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1212
#ifdef WIN32THREADS
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1213
		__resumeAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1214
#else
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1215
		ResumeThread(_masterThread);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1216
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1217
		DelObject(br);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1218
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1219
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1220
	    return 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1221
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1222
	case WM_PAINT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1223
	    EVENT_PRINTF(("WM_PAINT\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1224
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1225
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1226
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1227
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1228
	    if ((GetWindow_Flag(hWnd) & LI_INPUTWIN) == 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1229
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1230
	      if (GetUpdateRect(hWnd, &upd, TRUE))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1231
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1232
		  if ((GetWindow_Flag(hWnd) & LI_INPUTWIN) == 0)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1233
		  {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1234
		    if (GetWindow_eventMask(hWnd) & ExposureMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1235
		      enqEvent(ExposureMask,hWnd, message, wParam, upd.left, upd.top, upd.right, upd.bottom);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1236
		  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1237
	      }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1238
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1239
	    /**pDefault = 0;*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1240
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1241
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1242
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1243
	case WM_SIZE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1244
	    EVENT_PRINTF(("WM_SIZE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1245
	    switch(wParam)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1246
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1247
	      case SIZE_RESTORED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1248
	      case SIZE_MAXIMIZED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1249
		GetClientRect(hWnd, (LPRECT) &upd);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1250
		if (GetWindow_eventMask(hWnd) & ExposureMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1251
		  enqEvent(ExposureMask,hWnd, WM_PAINT, wParam, upd.left, upd.top, upd.right, upd.bottom);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1252
		DPRINTF(("WM_SIZE %x w %d h %d\n",hWnd,LOWORD(lParam),HIWORD(lParam)));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1253
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1254
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1255
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1256
	case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1257
	    EVENT_PRINTF(("WM_SHOWWINDOW\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1258
	    enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1259
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1260
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1261
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1262
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1263
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1264
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1265
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1266
	case WM_MOUSEACTIVATE :
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1267
	    EVENT_PRINTF2(("WM_MOUSEACTIVATE h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1268
	    *pDefault = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1269
	    if (GetActiveWindow())
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1270
	      return MA_NOACTIVATE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1271
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1272
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1273
	      //return MA_NOACTIVATE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1274
	      return MA_ACTIVATE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1275
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1276
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1277
	case WM_ACTIVATE:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1278
	    CPRINTF(("WM_ACTIVATE %s h=%x\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1279
			    LOWORD(wParam) ? "active" : "inactive",
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1280
			    hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1281
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1282
	    enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1283
	    switch (LOWORD(wParam)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1284
		case WA_INACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1285
		    EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1286
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1287
		case WA_ACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1288
		    EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1289
                    if (currentCapture == CAPTURE_NONE)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1290
                    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1291
		      POINT p;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1292
		      HWND hWndChild,hWndTemp;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1293
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1294
		      p.x = evRootX;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1295
		      p.y = evRootY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1296
		      ScreenToClient(hWnd, &p);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1297
                      hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1298
                      do
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1299
                      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1300
                        hWndTemp = hWndChild;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1301
                        hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1302
                      } while ((hWndChild) && (hWndChild != hWndTemp));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1303
		      /*printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1304
		      if (hWndChild /*&& (hWndChild != hWnd)*/)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1305
		      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1306
			  modifiers = getModifiers();
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1307
			  if (hWndChild != currentPointerView)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1308
			  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1309
			      if (currentPointerView)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1310
			      {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1311
				  if (GetWindow_eventMask(hWnd) & LeaveWindowMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1312
				    enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1313
				  currentPointerView = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1314
			      }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1315
			      if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1316
				enqEvent(EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1317
			      //SetFocus(hWndChild);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1318
			      currentPointerView = hWndChild;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1319
			  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1320
		      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1321
		    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1322
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1323
		case WA_CLICKACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1324
		    EVENT_PRINTF2(("WM_ACTIVATE clkactive h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1325
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1326
		default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1327
		    EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1328
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1329
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1330
	    if (isNative) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1331
		*pDefault = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1332
		return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1333
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1334
	    *pDefault = 0;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1335
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1336
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1337
	case WM_SYSCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1338
	    EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1339
	    goto commonChar;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1340
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1341
	case WM_CHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1342
	    EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1343
	commonChar:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1344
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1345
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1346
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1347
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1348
	    modifiers = getModifiers();
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1349
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1350
		POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1351
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1352
		p.x = evRootX;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1353
		p.y = evRootY;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1354
		ScreenToClient(hWnd, &p);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1355
		x = p.x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1356
		y = p.y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1357
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1358
	    if (currentPointerView)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1359
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1360
	      if (GetWindow_eventMask(currentPointerView) & KeyPressMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1361
		enqEvent(KeyPressMask,currentPointerView, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1362
	      if (GetWindow_eventMask(currentPointerView) & KeyReleaseMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1363
		enqEvent(KeyReleaseMask,currentPointerView, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1364
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1365
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1366
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1367
	      if (GetWindow_eventMask(hWnd) & KeyPressMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1368
		enqEvent(KeyPressMask,hWnd, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1369
	      if (GetWindow_eventMask(hWnd) & KeyReleaseMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1370
		enqEvent(KeyReleaseMask,hWnd, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1371
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1372
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1373
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1374
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1375
	case WM_KEYUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1376
	    EVENT_PRINTF2(("WM_KEYUP h=%x %x\n", hWnd, wParam));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1377
	    goto commonKeyUp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1378
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1379
	case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1380
	    EVENT_PRINTF2(("WM_SYSKEYUP %x\n, wParam"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1381
	commonKeyUp:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1382
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1383
		*pDefault = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1384
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1385
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1386
	    modifiers = getModifiers();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1387
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1388
		POINT p;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1389
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1390
		p.x = evRootX;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1391
		p.y = evRootY;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1392
		ScreenToClient(hWnd, &p);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1393
		x = p.x;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1394
		y = p.y;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1395
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1396
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1397
	    if (currentPointerView)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1398
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1399
	      if (GetWindow_eventMask(currentPointerView) & KeyReleaseMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1400
		enqEvent(KeyReleaseMask,currentPointerView, message, wParam, x, y, lParam, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1401
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1402
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1403
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1404
	      if (GetWindow_eventMask(hWnd) & KeyReleaseMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1405
		enqEvent(KeyReleaseMask,hWnd, message, wParam, x, y, lParam, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1406
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1407
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1408
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1409
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1410
	case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1411
	    EVENT_PRINTF2(("WM_SYSKEYDOWN %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1412
	    goto commonKey;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1413
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1414
	case WM_KEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1415
	    EVENT_PRINTF2(("WM_KEYDOWN h=%x %x\n", hWnd, wParam));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1416
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1417
	    /* while debugging ... */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1418
	    if (wParam == VK_ESCAPE) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1419
		ReleaseCapture();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1420
		currentCapture = CAPTURE_NONE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1421
                CPRINTF(("ReleaseCapture <ESC>\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1422
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1423
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1424
	commonKey:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1425
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1426
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1427
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1428
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1429
	    modifiers = getModifiers();
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1430
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1431
		POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1432
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1433
		p.x = evRootX;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1434
		p.y = evRootY;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1435
		ScreenToClient(hWnd, &p);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1436
		x = p.x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1437
		y = p.y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1438
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1439
	    if (currentPointerView)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1440
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1441
	      if (GetWindow_eventMask(currentPointerView) & KeyPressMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1442
		enqEvent(KeyPressMask,currentPointerView, message, wParam, x, y, lParam, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1443
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1444
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1445
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1446
	      if (GetWindow_eventMask(hWnd) & KeyPressMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1447
		enqEvent(KeyPressMask,hWnd, message, wParam, x, y, lParam, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1448
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1449
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1450
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1451
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1452
	case WM_MOUSEMOVE:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1453
	    EVENT_PRINTF3(("WM_MOUSEMOVE h=%x\n", hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1454
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1455
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1456
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1457
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1458
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1459
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1460
		short x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1461
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1462
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1463
		y = (int)(short)HIWORD(lParam);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1464
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1465
		modifiers = getModifiers();
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1466
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1467
		if (currentCapture == CAPTURE_NONE)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1468
                {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1469
                  if (hWnd != currentPointerView) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1470
                      if (currentPointerView) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1471
                          if (GetWindow_eventMask(hWnd) & LeaveWindowMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1472
                            enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1473
                          currentPointerView = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1474
                      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1475
                      if (GetWindow_eventMask(hWnd) & EnterWindowMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1476
                        enqEvent(EnterWindowMask,hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1477
                      currentPointerView = hWnd;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1478
                  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1479
                  CPRINTF(("MouseMove %x\n",currentPointerView));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1480
                }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1481
                else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1482
                {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1483
                  CPRINTF(("MouseMove Capture %x\n",currentPointerView));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1484
                }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1485
		if (    (GetWindow_eventMask(currentPointerView) & PointerMotionMask)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1486
		     || (modifiers & (Button1Mask|Button2Mask|Button3Mask))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1487
		   )
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1488
		     enqEvent(PointerMotionMask,currentPointerView, message, wParam, x, y, 0, modifiers);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1489
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1490
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1491
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1492
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1493
	case WM_LBUTTONUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1494
	case WM_MBUTTONUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1495
	case WM_RBUTTONUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1496
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1497
		*pDefault = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1498
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1499
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1500
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1501
	    if (currentCapture == CAPTURE_IMPLICIT) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1502
		currentCapture = CAPTURE_NONE;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1503
		ReleaseCapture();
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1504
                CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1505
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1506
	    modifiers = getModifiers();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1507
	    EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1508
			   hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1509
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1510
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1511
	    if (GetWindow_eventMask(hWnd) & ButtonReleaseMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1512
	      enqEvent(ButtonReleaseMask,hWnd, message, wParam, (int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1513
					      wParam,modifiers);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1514
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1515
	    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1516
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1517
	case WM_LBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1518
	case WM_MBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1519
	case WM_RBUTTONDOWN:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1520
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1521
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1522
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1523
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1524
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1525
	    if (currentCapture == CAPTURE_NONE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1526
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1527
		currentCapture = CAPTURE_IMPLICIT;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1528
		//SetFocus(hWnd);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1529
		SetCapture(hWnd);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1530
                CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1531
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1532
	    goto commonButton;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1533
	case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1534
	case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1535
	case WM_RBUTTONDBLCLK:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1536
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1537
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1538
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1539
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1540
	commonButton:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1541
	    modifiers = getModifiers();
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1542
	    EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1543
			   hWnd, LOWORD(lParam), HIWORD(lParam)));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1544
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1545
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1546
	    if (GetWindow_eventMask(hWnd) & ButtonPressMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1547
	      enqEvent(ButtonPressMask,hWnd, message, wParam, (int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1548
					      wParam,modifiers);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1549
	    *pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1550
	    break;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1551
	case WM_CAPTURECHANGED:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1552
	    CPRINTF(("WM_CAPTURECHANGED %x to %x\n",hWnd,lParam));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1553
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1554
	case WM_KILLFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1555
	    CPRINTF(("WM_KILLFOCUS\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1556
	    //enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1557
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1558
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1559
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1560
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1561
	    *pDefault = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1562
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1563
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1564
	case WM_SETFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1565
	    CPRINTF(("WM_SETFOCUS %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1566
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1567
	    //enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1568
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1569
	      POINT p;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1570
	      HWND hWndChild,hWndTemp;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1571
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1572
              p.x = evRootX;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1573
              p.y = evRootY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1574
              ScreenToClient(hWnd, &p);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1575
              hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1576
              do
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1577
              {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1578
                hWndTemp = hWndChild;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1579
                hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1580
              } while ((hWndChild) && (hWndChild != hWndTemp));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1581
	      /*printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1582
	      if (hWndChild /*&& (hWndChild != hWnd)*/)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1583
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1584
		  modifiers = getModifiers();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1585
		  if (hWndChild != currentPointerView)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1586
		  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1587
		      if (currentPointerView)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1588
		      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1589
			  if (GetWindow_eventMask(hWnd) & LeaveWindowMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1590
			    enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1591
			  currentPointerView = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1592
		      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1593
		      if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1594
			enqEvent(EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1595
		      //SetFocus(hWndChild);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1596
		      currentPointerView = hWndChild;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1597
		  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1598
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1599
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1600
#endif
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1601
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1602
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1603
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1604
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1605
	    *pDefault = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1606
	    break;                                                                                                                                                                                      
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1607
	case WM_STYLECHANGING:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1608
	    EVENT_PRINTF(("WM_STYLECHANGING\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1609
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1610
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1611
	case WM_STYLECHANGED:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1612
	    EVENT_PRINTF(("WM_STYLECHANGED\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1613
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1614
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1615
	case WM_GETTEXT:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1616
	    /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1617
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1618
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1619
	case WM_GETTEXTLENGTH:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1620
	    EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1621
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1622
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1623
	case WM_NCCREATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1624
	    EVENT_PRINTF(("WM_NCCREATE %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1625
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1626
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1627
	case WM_NCHITTEST:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1628
	    EVENT_PRINTF3(("WM_NCHITTEST %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1629
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1630
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1631
	case WM_NCMOUSEMOVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1632
	    {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1633
		short x, y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1634
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1635
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1636
		y = (int)(short)HIWORD(lParam);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1637
		EVENT_PRINTF(("WM_NCMOUSEMOVE %d/%d\n", x, y));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1638
		lastNCMouseX = x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1639
		lastNCMouseY = y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1640
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1641
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1642
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1643
	case WM_PARENTNOTIFY:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1644
	    EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1645
				hWnd, lParam, LOWORD(wParam)));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1646
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1647
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1648
	case WM_NCLBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1649
	    EVENT_PRINTF(("WM_NCLBUTTONDOWN\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1650
	    {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1651
		short x, y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1652
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1653
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1654
		y = (int)(short)HIWORD(lParam);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1655
		lastNCMouseX = x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1656
		lastNCMouseY = y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1657
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1658
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1659
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1660
	case WM_NCLBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1661
	    EVENT_PRINTF(("WM_NCLBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1662
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1663
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1664
	case WM_NCRBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1665
	    EVENT_PRINTF(("WM_NCRBUTTONDOWN\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1666
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1667
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1668
	case WM_NCRBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1669
	    EVENT_PRINTF(("WM_NCRBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1670
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1671
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1672
	case WM_NCMBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1673
	    EVENT_PRINTF(("WM_NCMBUTTONDOWN\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1674
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1675
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1676
	case WM_NCMBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1677
	    EVENT_PRINTF(("WM_NCMBUTTONUP\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1678
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1679
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1680
	case WM_SETTEXT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1681
	    EVENT_PRINTF(("WM_SETTEXT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1682
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1683
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1684
	case 0x88:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1685
	    EVENT_PRINTF(("0x88 (undoc)\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1686
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1687
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1688
	case WM_NCCALCSIZE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1689
	    EVENT_PRINTF(("WM_NCCALCSIZE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1690
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1691
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1692
	case WM_NCPAINT:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1693
	    EVENT_PRINTF3(("WM_NCPAINT\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1694
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1695
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1696
	case WM_SYSCOMMAND:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1697
	    switch (wParam & ~0x000F) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1698
		case SC_CLOSE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1699
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1700
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1701
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1702
		case SC_MOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1703
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1704
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1705
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1706
		case SC_RESTORE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1707
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1708
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1709
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1710
		case SC_SIZE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1711
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1712
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1713
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1714
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1715
		    EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1716
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1717
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1718
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1719
	case WM_INITMENU:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1720
	    EVENT_PRINTF(("WM_INITMENU\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1721
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1722
	case WM_INITMENUPOPUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1723
	    EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1724
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1725
	case WM_ENTERIDLE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1726
	    EVENT_PRINTF(("WM_ENTERIDLE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1727
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1728
	case WM_ENTERMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1729
	    EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1730
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1731
	case WM_EXITMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1732
	    EVENT_PRINTF(("WM_EXITMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1733
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1734
	case WM_MENUSELECT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1735
	    EVENT_PRINTF(("WM_MENUSELECT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1736
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1737
	case WM_QUIT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1738
	    EVENT_PRINTF(("WM_QUIT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1739
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1740
	case WM_NCDESTROY:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1741
	    EVENT_PRINTF(("WM_NCDESTROY\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1742
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1743
	case WM_QUERYNEWPALETTE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1744
	    EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1745
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1746
	case WM_PALETTECHANGED:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1747
	    EVENT_PRINTF(("WM_PALETTECHANGED\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1748
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1749
	case WM_NCACTIVATE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1750
	    EVENT_PRINTF(("WM_NCACTIVATE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1751
	    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1752
	case WM_ACTIVATEAPP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1753
	    EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1754
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1755
	case WM_SYSDEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1756
	    EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1757
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1758
	case WM_DEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1759
	    EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1760
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1761
	case WM_PAINTICON:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1762
	    EVENT_PRINTF(("WM_PAINTICON\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1763
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1764
	case WM_ICONERASEBKGND:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1765
	    EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1766
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1767
	case WM_WINDOWPOSCHANGING:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1768
	    EVENT_PRINTF(("WM_WINDOWPOSCHANGING\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1769
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1770
	case WM_QUERYOPEN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1771
	    EVENT_PRINTF(("WM_QUERYOPEN\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1772
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1773
	case WM_QUERYENDSESSION:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1774
	    EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1775
	    break;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1776
	case WM_FONTCHANGE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1777
	    EVENT_PRINTF(("WM_FONTCHANGE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1778
	    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1779
	case WM_MOVING:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1780
	    EVENT_PRINTF(("WM_MOVING\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1781
	    break;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1782
	case WM_SYSCOLORCHANGE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1783
	    EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1784
	    break;
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1785
	case WM_SIZING:
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1786
	    EVENT_PRINTF(("WM_SIZING\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1787
	    /*__debugEvent__();*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1788
	    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1789
	case WM_EXITSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1790
	    EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1791
	    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1792
	case WM_ENTERSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1793
	    EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1794
	    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1795
	case WM_MOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1796
	    EVENT_PRINTF(("WM_MOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1797
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1798
	default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1799
	    EVENT_PRINTF(("msg = %x\n", message));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1800
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1801
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1802
    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1803
}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1804
static
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1805
winEventProcessingRoot(hWnd, message, wParam, lParam, pDefault)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1806
    HWND hWnd;                /* window handle                   */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1807
    UINT message;             /* type of message                 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1808
    UINT wParam;              /* additional information          */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1809
    LONG lParam;              /* additional information          */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1810
    int *pDefault;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1811
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1812
    LPMINMAXINFO lpmmi;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1813
    WINDOWPOS *posStruct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1814
    RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1815
    RECT upd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1816
    int modifiers;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1817
    int x, y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1818
    PAINTSTRUCT ps;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1819
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1820
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1821
/*    printf("winEvent hWin=0x%x message=0x%x wP=0x%x lP=0x%x\n",
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1822
			hWnd, message, wParam, lParam);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1823
*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1824
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1825
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1826
    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1827
     * messages which are enqueued to be handled by the view thread
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1828
     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1829
    switch (message) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1830
	case WM_CREATE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1831
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1832
	      CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1833
	      SETLOCALWINDOWINFOPTR(hWnd,lpcs->lpCreateParams);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1834
	      if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1835
		DPRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1836
	      *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1837
	      DPRINTF(("WM_CREATE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1838
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1839
	    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1840
	case WM_SETCURSOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1841
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1842
		HCURSOR curs;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1843
		int hitCode;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1844
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1845
		hitCode = LOWORD(lParam);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1846
		if (hitCode != HTCLIENT) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1847
		    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1848
		     * not in client area ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1849
		     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1850
		    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1851
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1852
		DDPRINTF(("WM_SETCURSOR\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1853
		curs = GetWindow_Cursor(hWnd);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1854
		if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1855
		    SetCursor(curs);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1856
		    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1857
		    return 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1858
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1859
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
	    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1862
	case WM_SYSCHAR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1863
	    EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1864
	    goto commonChar;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1865
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1866
	case WM_CHAR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1867
	    EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1868
	commonChar:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1869
	    modifiers = getModifiers();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1870
	    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1871
	    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1872
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1873
	case WM_SYSKEYUP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1874
	    EVENT_PRINTF2(("WM_SYSKEYUP %x\n, wParam"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1875
	    goto commonKey;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1876
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1877
	case WM_SYSKEYDOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1878
	    EVENT_PRINTF2(("WM_SYSKEYDOWN %x\n, wParam"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1879
	    goto commonKey;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1880
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1881
	case WM_KEYUP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1882
	    EVENT_PRINTF2(("WM_KEYUP h=%x %x\n", hWnd, wParam));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1883
	    goto commonKey;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1884
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1885
	case WM_KEYDOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1886
	    EVENT_PRINTF2(("WM_KEYDOWN h=%x %x\n", hWnd, wParam));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1887
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1888
	    /* while debugging ... */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1889
	    if (wParam == VK_ESCAPE) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1890
		ReleaseCapture();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1891
		currentCapture = CAPTURE_NONE;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1892
		ShowWindow(hWnd,SW_HIDE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1893
                CPRINTF(("rootReleaseCapture <ESC>\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1894
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1895
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1896
	commonKey:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1897
	    modifiers = getModifiers();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1898
	    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1899
	    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1900
	case WM_LBUTTONDOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1901
	case WM_MBUTTONDOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1902
	case WM_RBUTTONDOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1903
	    goto commonButton;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1904
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1905
	case WM_LBUTTONUP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1906
	case WM_MBUTTONUP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1907
	case WM_RBUTTONUP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1908
	    ReleaseCapture();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1909
	    ShowWindow(hWnd,SW_HIDE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1910
	    currentCapture = CAPTURE_NONE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1911
            CPRINTF(("rootReleaseCapture <BUTTONUP>\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1912
	    goto commonButton;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1913
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1914
	case WM_LBUTTONDBLCLK:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1915
	case WM_MBUTTONDBLCLK:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1916
	case WM_RBUTTONDBLCLK:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1917
	commonButton:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1918
	    modifiers = getModifiers();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1919
	    EVENT_PRINTF3(("WM_BUTTONUP/DOWN h=%x pos=%d/%d\n",
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1920
			   hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1921
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1922
	    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1923
	    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1924
	default:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1925
	    EVENT_PRINTF(("msg = %x\n", message));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1926
	    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1927
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1928
    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1929
}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1930
LONG APIENTRY
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1931
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1932
LONG APIENTRY
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1933
MainWndProcRoot(HWND hWnd,UINT message,UINT wParam,LONG lParam);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1934
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1935
void _USERENTRY dispatchThread(void *arg)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1936
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1937
    static int th_calls;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1938
    RECT rect;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1939
    MSG msg;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1940
    localWindowInfo *li;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1941
    _dispatchThreadId = GetCurrentThreadId();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1942
    TH_DPRINTF(("TS %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1943
    PeekMessage(&msg,NULL,0,0,PM_NOREMOVE);   /* must be */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1944
#ifndef WIN32THREADS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1945
    AttachThreadInput(_dispatchThreadId,_masterThreadId,TRUE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1946
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1947
    /*SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1948
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1949
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1950
    GetWindowRect(GetDesktopWindow(), &rect);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1951
    /* allocate localMemory for Window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1952
    li = (localWindowInfo*)malloc(sizeof(localWindowInfo));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1953
    if (li)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1954
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1955
      memset(li,0,sizeof(*_thread_local));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1956
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1957
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1958
    __rootWinSpezial = CreateWindowEx( WS_EX_TRANSPARENT,app_nameroot,app_nameroot,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1959
				0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1960
				rect.right-rect.left,rect.bottom-rect.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1961
				0,0,(HANDLE) __getHInstance(),li);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1962
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1963
    /*printf("__rootWinSpezial %x\n",__rootWinSpezial);*/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1964
    SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1965
    SetEvent(hCreateEvent);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1966
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1967
    while (bdispatchThreadState)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1968
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1969
	TH_DPRINTF(("TG %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1970
	GetMessage(&msg, NULL, 0, 0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1971
	TH_DPRINTF(("TD %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1972
	destroyWin = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1973
	if (msg.message == WM_THREADDESTROYWINDOW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1974
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1975
	  destroyWin = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1976
	  msg.message = WM_CLOSE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1977
	  CPRINTF(("thread WM_THREADDESTROYWINDOW %x\n",msg.hwnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1978
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1979
	else if (msg.message == WM_THREADSETFOCUS)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1980
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1981
#ifdef WIN32THREADS
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1982
	  if (msg.lParam)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1983
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1984
	    if (AttachThreadInput(_dispatchThreadId,msg.lParam,TRUE) == FALSE)
2236
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
  1985
	      CPRINTF(("SetFocus AttachThreadInput error %d\n",GetLastError()));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1986
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1987
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1988
	  CPRINTF(("threadSetfocus %x\n",msg.wParam));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1989
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1990
	  SetFocus((HWND)msg.wParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1991
	  continue;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1992
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1993
	else if (msg.message == WM_THREADSETCAPTURE)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1994
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1995
	  if (msg.wParam)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1996
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1997
            currentPointerView = msg.wParam;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1998
 	    currentCapture = CAPTURE_EXPLICIT;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1999
	    CPRINTF(("threadSetCapture %x\n",msg.wParam));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2000
            SetCapture(currentPointerView);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2001
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2002
          else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2003
          {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2004
            currentPointerView = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2005
            currentCapture = CAPTURE_NONE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2006
	    CPRINTF(("threadReleaseCapture\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2007
            ReleaseCapture();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2008
          }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2009
	  if (msg.lParam)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2010
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2011
              CPRINTF(("threadSetCursor %x\n",msg.lParam));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2012
	      SetCursor((HCURSOR)msg.lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2013
          }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2014
	  continue;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2015
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2016
	else if (msg.message == WM_THREADCREATEWINDOW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2017
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2018
	  TH_DPRINTF(("C %d\n", th_calls));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2019
          if (_thread_winStyleBits & WS_POPUP)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2020
          {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2021
            _thread_parentHandle = GetActiveWindow();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2022
          }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2023
	  _thread_newWinHandle = CreateWindowEx(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2024
				      _thread_winStyleBitsEx,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2025
				      _thread_className,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2026
				      _thread_windowName,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2027
				      _thread_winStyleBits,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2028
				      _thread_x, _thread_y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2029
				      _thread_dx,_thread_dy,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2030
				      _thread_parentHandle,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2031
				      NULL,           /* menu */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2032
				      (HANDLE) __getHInstance(),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2033
				      _thread_local);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2034
	  SetEvent(hCreateEvent);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2035
	  continue;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2036
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2037
	/* TranslateMessage(&msg); */ /* Translates virtual key codes */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2038
	if (   (msg.message == WM_KEYDOWN)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2039
	    || (msg.message == WM_KEYUP)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2040
	    || (msg.message == WM_SYSKEYDOWN)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2041
	    || (msg.message == WM_SYSKEYUP)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2042
	   )
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2043
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2044
#ifdef xxDEBUG
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2045
	   if ((msg.wParam == 0x11) && (msg.message == WM_KEYDOWN))/* CTRL-C */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2046
	   {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2047
	     if (c_count++ > 3)  /* for debugging */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2048
		exit(1);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2049
	   }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2050
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2051
	    /*printf("keymsg %x\n",msg.wParam);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2052
	    if (
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2053
		   ((msg.wParam >= '0') && (msg.wParam <= 'Z'))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2054
		|| (msg.wParam == 0x20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2055
		|| (msg.wParam == 0x14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2056
		/*|| (msg.wParam == 0x10)*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2057
		|| (msg.wParam >= 0xB0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2058
	       )
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2059
	    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2060
		/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2061
		 * translate to a WM_CHAR message
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2062
		 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2063
		if (TranslateMessage(&msg))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2064
		    continue;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2065
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2066
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2067
	evRootX = msg.pt.x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2068
	evRootY = msg.pt.y;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2069
	lastMSGTime = msg.time;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2070
	DispatchMessage(&msg);   /* Dispatches message to window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2071
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2072
    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2073
}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2074
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2075
LONG APIENTRY
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2076
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2077
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2078
    int wantDefault = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2079
    int retVal;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2080
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2081
    TH_DPRINTF(("TMW %d\n",message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2082
    retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2083
    if (wantDefault) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2084
	DDPRINTF((">>DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2085
	retVal = DefWindowProc(hWnd, message, wParam, lParam);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2086
	DDPRINTF(("<<DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2087
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2088
    return retVal;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2089
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2090
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2091
LONG APIENTRY
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2092
MainWndProcRoot(HWND hWnd,UINT message,UINT wParam,LONG lParam)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2093
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2094
    int wantDefault = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2095
    int retVal;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2096
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2097
    TH_DPRINTF(("TMW %d\n",message));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2098
    retVal = winEventProcessingRoot(hWnd, message, wParam, lParam, &wantDefault);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2099
    return TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2100
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2101
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2102
int CALLBACK
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2103
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData )
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2104
	LOGFONT*        lplf;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2105
	TEXTMETRIC*     lptm;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2106
	DWORD           dwType;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2107
	LPARAM          lpData;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2108
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2109
	OBJ t;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2110
	OBJ* refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2111
	OBJ  typeFaceList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2112
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2113
	if (lplf) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2114
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2115
	    __PROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2116
	    t = __MKSTRING( lplf->lfFaceName );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2117
	    __UNPROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2118
	    typeFaceList = *refToList;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2119
	    __SSEND1( typeFaceList, @symbol(add:), 0, t );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2120
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2121
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2122
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2123
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2124
int CALLBACK
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2125
EnumFontsProc( lplf, lptm, dwType, lpData )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2126
	LOGFONT*      lplf;     /* address of logical-font data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2127
	TEXTMETRIC*   lptm;     /* address of physical font data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2128
	DWORD         dwType;   /* font type */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2129
	LPARAM        lpData;   /* address of application supplied data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2130
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2131
	OBJ newArray, t;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2132
	OBJ *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2133
	OBJ list;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2134
	char *s;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2135
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2136
	DPRINTF(("EnumFontProc\n\n\n\n"));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2137
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2138
	if( lplf ) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2139
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2140
	    __PROTECT__(*refToList);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2141
	    DPRINTF((" lfHeight          %d\n", lplf->lfHeight ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2142
	    DPRINTF((" lfWidth           %d\n", lplf->lfWidth  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2143
	    DPRINTF((" lfEscapement      %d\n", lplf->lfEscapement  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2144
	    DPRINTF((" lfOrientation     %d\n", lplf->lfOrientation  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2145
	    DPRINTF((" lfWeight          %d\n", lplf->lfWeight  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2146
	    DPRINTF((" lfItalic          %d\n", lplf->lfItalic  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2147
	    DPRINTF((" lfUnderline       %d\n", lplf->lfUnderline  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2148
	    DPRINTF((" lfStrikeOut       %d\n", lplf->lfStrikeOut  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2149
	    DPRINTF((" lfCharSet         %d\n", lplf->lfCharSet  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2150
	    DPRINTF((" lfOutPrecision    %d\n", lplf->lfOutPrecision  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2151
	    DPRINTF((" lfClipPrecision   %d\n", lplf->lfClipPrecision  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2152
	    DPRINTF((" lfQuality         %d\n", lplf->lfQuality  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2153
	    DPRINTF((" lfPitchAndFamily  %d\n", lplf->lfPitchAndFamily  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2154
	    DPRINTF((" lfFaceName        %s\n\n", lplf->lfFaceName  ));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2155
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2156
	    newArray = __ARRAY_NEW_INT(16);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2157
	    __UNPROTECT__(*refToList);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2158
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2159
	    if ( dwType & TRUETYPE_FONTTYPE )
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2160
	      __ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(0);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2161
	    else
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2162
	      //__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(MulDiv(__logPixelSY,lplf->lfHeight, 72));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2163
	      __ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2164
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2165
	    __ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2166
	    __ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2167
	    __ArrayInstPtr(newArray)->a_element[3] = __MKSMALLINT(lplf->lfOrientation);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2168
	    switch (lplf->lfWeight) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2169
		case FW_NORMAL:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2170
		    s = "normal";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2171
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2172
		case FW_BOLD:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2173
		    s = "bold";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2174
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2175
		case FW_MEDIUM:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2176
		    s = "medium";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2177
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2178
		case FW_LIGHT:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2179
		    s = "demi";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2180
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2181
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2182
		    s = "other";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2183
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2184
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2185
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2186
	    __PROTECT__(newArray);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2187
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2188
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2189
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2190
	    __ArrayInstPtr(newArray)->a_element[4] = t; __STORE(newArray, t);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2191
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2192
	    if( lplf->lfItalic == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2193
		if( lplf->lfUnderline == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2194
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2195
			s = "italic-underline-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2196
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2197
			s = "italic-underline";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2198
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2199
		} else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2200
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2201
			s = "italic-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2202
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2203
			s = "italic";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2204
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2205
		}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2206
	    } else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2207
		if( lplf->lfUnderline == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2208
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2209
			s = "underline-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2210
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2211
			s = "underline";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2212
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2213
		} else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2214
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2215
			s = "strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2216
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2217
			s = "normal";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2218
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2219
		}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2220
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2221
	    __PROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2222
	    __PROTECT__(newArray);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2223
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2224
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2225
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2226
	    __ArrayInstPtr(newArray)->a_element[15] = t; __STORE(newArray, t);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2227
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2228
	    __ArrayInstPtr(newArray)->a_element[5] = __MKSMALLINT(lplf->lfItalic);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2229
	    __ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfUnderline);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2230
	    __ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfStrikeOut);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2231
	    __ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfCharSet);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2232
	    __ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfOutPrecision);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2233
	    __ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfClipPrecision);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2234
	    __ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfQuality);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2235
	    __ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfPitchAndFamily);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2236
	    /* ... */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2237
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2238
	    __PROTECT__(newArray);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2239
	    t = __MKSTRING(lplf->lfFaceName);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2240
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2241
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2242
	    __ArrayInstPtr(newArray)->a_element[13] = t; __STORE(newArray, t);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2243
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2244
	    switch (lplf->lfCharSet) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2245
		case ANSI_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2246
		    s = "ansi";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2247
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2248
		case DEFAULT_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2249
		    s = "default";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2250
		case SYMBOL_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2251
		    s = "symbol";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2252
		case SHIFTJIS_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2253
		    s = "sjis";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2254
		case GB2312_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2255
		    s = "gb";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2256
		case HANGEUL_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2257
		    s = "hangeul";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2258
		case CHINESEBIG5_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2259
		    s = "big5";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2260
		case OEM_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2261
		    s = "oem";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2262
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2263
# ifdef JOHAB_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2264
		case JOHAB_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2265
		    s = "johab";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2266
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2267
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2268
# ifdef HEBREW_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2269
		case HEBREW_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2270
		    s = "hebrew";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2271
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2272
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2273
# ifdef GREEK_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2274
		case GREEK_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2275
		    s = "greek";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2276
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2277
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2278
# ifdef RUSSIAN_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2279
		case RUSSIAN_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2280
		    s = "russian";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2281
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2282
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2283
# ifdef MAC_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2284
		case MAC_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2285
		    s = "mac";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2286
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2287
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2288
		default:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2289
		    s = "unknown";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2290
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2291
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2292
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2293
	    __PROTECT__(newArray);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2294
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2295
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2296
	    __UNPROTECT__(*refToList);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2297
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2298
	    __ArrayInstPtr(newArray)->a_element[14] = t; __STORE(newArray, t);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2299
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2300
	    list = *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2301
	    __SSEND1(list, @symbol(add:), 0, newArray);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2302
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2303
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2304
	DPRINTF((" dwType            %d\n", dwType ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2305
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2306
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2307
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2308
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2309
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2310
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2311
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2312
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2313
copyright
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2314
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2315
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2316
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2317
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2318
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2319
 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
  2320
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2321
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2322
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2323
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2324
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2325
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2326
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2327
documentation
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2328
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2329
    See more documentation in my superclass, DeviceWorkstation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2330
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2331
    [author:]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2332
	Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2333
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2334
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2335
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2336
!WinWorkstation class methodsFor:'initialization'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2337
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2338
initialize
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2339
    |nButtons swap|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2340
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2341
    super initialize.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2342
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2343
    self initializeStandardColorNames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2344
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2345
    NativeWindows := false.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2346
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2347
    BeepFrequency := 440.       "/ Hertz
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2348
    BeepDuration := 200.        "/ millis
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2349
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2350
    ButtonTranslation := #(1 2 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2351
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2352
    nButtons := self getSystemMetrics:#mouseButtons.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2353
    swap := self getSystemMetrics:#swapButton.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2354
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2355
    nButtons == 0 ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2356
	'WinWorkstation [warning]: mouse-less operation may not work' infoPrintCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2357
    ] ifFalse:[
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2358
	nButtons == 2 ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2359
	    ButtonTranslation := #(1 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2360
	].
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2361
	swap ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2362
	    ButtonTranslation := ButtonTranslation copy reverse
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2363
	]
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2364
    ].
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2365
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2366
    "/ translation table from ST/X windowType symbol (system-independent)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2367
    "/ to Windows windowClass (windows-specific).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2368
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2369
    NativeWindowClassTable := IdentityDictionary new.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2370
    NativeWindowClassTable at:#ScrollBar     put:'SCROLLBAR'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2371
    NativeWindowClassTable at:#CheckBox      put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2372
    NativeWindowClassTable at:#RadioButton   put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2373
    NativeWindowClassTable at:#Button        put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2374
    NativeWindowClassTable at:#DefaultButton put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2375
    NativeWindowClassTable at:#ComboBox      put:'COMBOBOX'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2376
    NativeWindowClassTable at:#EditField     put:'EDIT'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2377
    NativeWindowClassTable at:#ListBox       put:'LISTBOX'.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2378
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2379
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2380
initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2381
    "{ Pragma: +optSpace }"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2382
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2383
    "setup standard colors"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2384
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2385
    StandardColorValues := Dictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2386
    #(
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2387
	(240 248 255)   'alice blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2388
	(240 248 255)   'AliceBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2389
	(250 235 215)   'antique white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2390
	(250 235 215)   'AntiqueWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2391
	(255 239 219)   'AntiqueWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2392
	(238 223 204)   'AntiqueWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2393
	(205 192 176)   'AntiqueWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2394
	(139 131 120)   'AntiqueWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2395
	(127 255 212)   'aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2396
	(127 255 212)   'aquamarine1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2397
	(118 238 198)   'aquamarine2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2398
	(102 205 170)   'aquamarine3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2399
	( 69 139 116)   'aquamarine4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2400
	(240 255 255)   'azure'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2401
	(240 255 255)   'azure1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2402
	(224 238 238)   'azure2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2403
	(193 205 205)   'azure3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2404
	(131 139 139)   'azure4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2405
	(245 245 220)   'beige'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2406
	(255 228 196)   'bisque'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2407
	(255 228 196)   'bisque1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2408
	(238 213 183)   'bisque2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2409
	(205 183 158)   'bisque3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2410
	(139 125 107)   'bisque4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2411
	(  0   0   0)   'black'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2412
	(255 235 205)   'blanched almond'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2413
	(255 235 205)   'BlanchedAlmond'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2414
	(  0   0 255)   'blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2415
	(138  43 226)   'blue violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2416
	(  0   0 255)   'blue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2417
	(  0   0 238)   'blue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2418
	(  0   0 205)   'blue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2419
	(  0   0 139)   'blue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2420
	(138  43 226)   'BlueViolet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2421
	(165  42  42)   'brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2422
	(255  64  64)   'brown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2423
	(238  59  59)   'brown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2424
	(205  51  51)   'brown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2425
	(139  35  35)   'brown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2426
	(222 184 135)   'burlywood'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2427
	(255 211 155)   'burlywood1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2428
	(238 197 145)   'burlywood2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2429
	(205 170 125)   'burlywood3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2430
	(139 115  85)   'burlywood4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2431
	( 95 158 160)   'cadet blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2432
	( 95 158 160)   'CadetBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2433
	(152 245 255)   'CadetBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2434
	(142 229 238)   'CadetBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2435
	(122 197 205)   'CadetBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2436
	( 83 134 139)   'CadetBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2437
	(127 255   0)   'chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2438
	(127 255   0)   'chartreuse1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2439
	(118 238   0)   'chartreuse2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2440
	(102 205   0)   'chartreuse3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2441
	( 69 139   0)   'chartreuse4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2442
	(210 105  30)   'chocolate'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2443
	(255 127  36)   'chocolate1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2444
	(238 118  33)   'chocolate2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2445
	(205 102  29)   'chocolate3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2446
	(139  69  19)   'chocolate4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2447
	(255 127  80)   'coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2448
	(255 114  86)   'coral1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2449
	(238 106  80)   'coral2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2450
	(205  91  69)   'coral3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2451
	(139  62  47)   'coral4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2452
	(100 149 237)   'cornflower blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2453
	(100 149 237)   'CornflowerBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2454
	(255 248 220)   'cornsilk'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2455
	(255 248 220)   'cornsilk1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2456
	(238 232 205)   'cornsilk2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2457
	(205 200 177)   'cornsilk3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2458
	(139 136 120)   'cornsilk4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2459
	(  0 255 255)   'cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2460
	(  0 255 255)   'cyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2461
	(  0 238 238)   'cyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2462
	(  0 205 205)   'cyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2463
	(  0 139 139)   'cyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2464
	(  0   0 139)   'dark blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2465
	(  0 139 139)   'dark cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2466
	(184 134  11)   'dark goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2467
	(169 169 169)   'dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2468
	(  0 100   0)   'dark green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2469
	(169 169 169)   'dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2470
	(189 183 107)   'dark khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2471
	(139   0 139)   'dark magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2472
	( 85 107  47)   'dark olive green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2473
	(255 140   0)   'dark orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2474
	(153  50 204)   'dark orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2475
	(139   0   0)   'dark red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2476
	(233 150 122)   'dark salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2477
	(143 188 143)   'dark sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2478
	( 72  61 139)   'dark slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2479
	( 47  79  79)   'dark slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2480
	( 47  79  79)   'dark slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2481
	(  0 206 209)   'dark turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2482
	(148   0 211)   'dark violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2483
	(  0   0 139)   'DarkBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2484
	(  0 139 139)   'DarkCyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2485
	(184 134  11)   'DarkGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2486
	(255 185  15)   'DarkGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2487
	(238 173  14)   'DarkGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2488
	(205 149  12)   'DarkGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2489
	(139 101   8)   'DarkGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2490
	(169 169 169)   'DarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2491
	(  0 100   0)   'DarkGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2492
	(169 169 169)   'DarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2493
	(189 183 107)   'DarkKhaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2494
	(139   0 139)   'DarkMagenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2495
	( 85 107  47)   'DarkOliveGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2496
	(202 255 112)   'DarkOliveGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2497
	(188 238 104)   'DarkOliveGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2498
	(162 205  90)   'DarkOliveGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2499
	(110 139  61)   'DarkOliveGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2500
	(255 140   0)   'DarkOrange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2501
	(255 127   0)   'DarkOrange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2502
	(238 118   0)   'DarkOrange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2503
	(205 102   0)   'DarkOrange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2504
	(139  69   0)   'DarkOrange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2505
	(153  50 204)   'DarkOrchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2506
	(191  62 255)   'DarkOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2507
	(178  58 238)   'DarkOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2508
	(154  50 205)   'DarkOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2509
	(104  34 139)   'DarkOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2510
	(139   0   0)   'DarkRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2511
	(233 150 122)   'DarkSalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2512
	(143 188 143)   'DarkSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2513
	(193 255 193)   'DarkSeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2514
	(180 238 180)   'DarkSeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2515
	(155 205 155)   'DarkSeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2516
	(105 139 105)   'DarkSeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2517
	( 72  61 139)   'DarkSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2518
	( 47  79  79)   'DarkSlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2519
	(151 255 255)   'DarkSlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2520
	(141 238 238)   'DarkSlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2521
	(121 205 205)   'DarkSlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2522
	( 82 139 139)   'DarkSlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2523
	( 47  79  79)   'DarkSlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2524
	(  0 206 209)   'DarkTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2525
	(148   0 211)   'DarkViolet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2526
	(255  20 147)   'deep pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2527
	(  0 191 255)   'deep sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2528
	(255  20 147)   'DeepPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2529
	(255  20 147)   'DeepPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2530
	(238  18 137)   'DeepPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2531
	(205  16 118)   'DeepPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2532
	(139  10  80)   'DeepPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2533
	(  0 191 255)   'DeepSkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2534
	(  0 191 255)   'DeepSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2535
	(  0 178 238)   'DeepSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2536
	(  0 154 205)   'DeepSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2537
	(  0 104 139)   'DeepSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2538
	(105 105 105)   'dim gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2539
	(105 105 105)   'dim grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2540
	(105 105 105)   'DimGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2541
	(105 105 105)   'DimGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2542
	( 30 144 255)   'dodger blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2543
	( 30 144 255)   'DodgerBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2544
	( 30 144 255)   'DodgerBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2545
	( 28 134 238)   'DodgerBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2546
	( 24 116 205)   'DodgerBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2547
	( 16  78 139)   'DodgerBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2548
	(178  34  34)   'firebrick'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2549
	(255  48  48)   'firebrick1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2550
	(238  44  44)   'firebrick2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2551
	(205  38  38)   'firebrick3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2552
	(139  26  26)   'firebrick4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2553
	(255 250 240)   'floral white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2554
	(255 250 240)   'FloralWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2555
	( 34 139  34)   'forest green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2556
	( 34 139  34)   'ForestGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2557
	(220 220 220)   'gainsboro'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2558
	(248 248 255)   'ghost white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2559
	(248 248 255)   'GhostWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2560
	(255 215   0)   'gold'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2561
	(255 215   0)   'gold1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2562
	(238 201   0)   'gold2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2563
	(205 173   0)   'gold3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2564
	(139 117   0)   'gold4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2565
	(218 165  32)   'goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2566
	(255 193  37)   'goldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2567
	(238 180  34)   'goldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2568
	(205 155  29)   'goldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2569
	(139 105  20)   'goldenrod4'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2570
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2571
	(192 192 192)   'grey'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2572
	(  0   0   0)   'grey0'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2573
	(  3   3   3)   'grey1'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2574
	( 26  26  26)   'grey10'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2575
	(255 255 255)   'grey100'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2576
	( 28  28  28)   'grey11'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2577
	( 31  31  31)   'grey12'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2578
	( 33  33  33)   'grey13'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2579
	( 36  36  36)   'grey14'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2580
	( 38  38  38)   'grey15'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2581
	( 41  41  41)   'grey16'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2582
	( 43  43  43)   'grey17'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2583
	( 46  46  46)   'grey18'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2584
	( 48  48  48)   'grey19'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2585
	(  5   5   5)   'grey2'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2586
	( 51  51  51)   'grey20'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2587
	( 54  54  54)   'grey21'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2588
	( 56  56  56)   'grey22'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2589
	( 59  59  59)   'grey23'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2590
	( 61  61  61)   'grey24'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2591
	( 64  64  64)   'grey25'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2592
	( 66  66  66)   'grey26'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2593
	( 69  69  69)   'grey27'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2594
	( 71  71  71)   'grey28'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2595
	( 74  74  74)   'grey29'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2596
	(  8   8   8)   'grey3'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2597
	( 77  77  77)   'grey30'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2598
	( 79  79  79)   'grey31'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2599
	( 82  82  82)   'grey32'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2600
	( 84  84  84)   'grey33'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2601
	( 87  87  87)   'grey34'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2602
	( 89  89  89)   'grey35'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2603
	( 92  92  92)   'grey36'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2604
	( 94  94  94)   'grey37'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2605
	( 97  97  97)   'grey38'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2606
	( 99  99  99)   'grey39'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2607
	( 10  10  10)   'grey4'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2608
	(102 102 102)   'grey40'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2609
	(105 105 105)   'grey41'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2610
	(107 107 107)   'grey42'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2611
	(110 110 110)   'grey43'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2612
	(112 112 112)   'grey44'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2613
	(115 115 115)   'grey45'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2614
	(117 117 117)   'grey46'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2615
	(120 120 120)   'grey47'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2616
	(122 122 122)   'grey48'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2617
	(125 125 125)   'grey49'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2618
	( 13  13  13)   'grey5'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2619
	(127 127 127)   'grey50'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2620
	(130 130 130)   'grey51'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2621
	(133 133 133)   'grey52'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2622
	(135 135 135)   'grey53'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2623
	(138 138 138)   'grey54'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2624
	(140 140 140)   'grey55'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2625
	(143 143 143)   'grey56'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2626
	(145 145 145)   'grey57'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2627
	(148 148 148)   'grey58'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2628
	(150 150 150)   'grey59'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2629
	( 15  15  15)   'grey6'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2630
	(153 153 153)   'grey60'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2631
	(156 156 156)   'grey61'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2632
	(158 158 158)   'grey62'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2633
	(161 161 161)   'grey63'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2634
	(163 163 163)   'grey64'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2635
	(166 166 166)   'grey65'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2636
	(168 168 168)   'grey66'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2637
	(171 171 171)   'grey67'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2638
	(173 173 173)   'grey68'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2639
	(176 176 176)   'grey69'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2640
	( 18  18  18)   'grey7'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2641
	(179 179 179)   'grey70'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2642
	(181 181 181)   'grey71'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2643
	(184 184 184)   'grey72'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2644
	(186 186 186)   'grey73'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2645
	(189 189 189)   'grey74'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2646
	(191 191 191)   'grey75'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2647
	(194 194 194)   'grey76'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2648
	(196 196 196)   'grey77'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2649
	(199 199 199)   'grey78'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2650
	(201 201 201)   'grey79'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2651
	( 20  20  20)   'grey8'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2652
	(204 204 204)   'grey80'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2653
	(207 207 207)   'grey81'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2654
	(209 209 209)   'grey82'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2655
	(212 212 212)   'grey83'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2656
	(214 214 214)   'grey84'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2657
	(217 217 217)   'grey85'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2658
	(219 219 219)   'grey86'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2659
	(222 222 222)   'grey87'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2660
	(224 224 224)   'grey88'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2661
	(227 227 227)   'grey89'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2662
	( 23  23  23)   'grey9'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2663
	(229 229 229)   'grey90'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2664
	(232 232 232)   'grey91'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2665
	(235 235 235)   'grey92'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2666
	(237 237 237)   'grey93'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2667
	(240 240 240)   'grey94'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2668
	(242 242 242)   'grey95'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2669
	(245 245 245)   'grey96'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2670
	(247 247 247)   'grey97'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2671
	(250 250 250)   'grey98'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2672
	(252 252 252)   'grey99'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2673
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2674
	(192 192 192)   'gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2675
	(  0   0   0)   'gray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2676
	(  3   3   3)   'gray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2677
	( 26  26  26)   'gray10'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2678
	(255 255 255)   'gray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2679
	( 28  28  28)   'gray11'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2680
	( 31  31  31)   'gray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2681
	( 33  33  33)   'gray13'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2682
	( 36  36  36)   'gray14'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2683
	( 38  38  38)   'gray15'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2684
	( 41  41  41)   'gray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2685
	( 43  43  43)   'gray17'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2686
	( 46  46  46)   'gray18'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2687
	( 48  48  48)   'gray19'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2688
	(  5   5   5)   'gray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2689
	( 51  51  51)   'gray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2690
	( 54  54  54)   'gray21'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2691
	( 56  56  56)   'gray22'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2692
	( 59  59  59)   'gray23'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2693
	( 61  61  61)   'gray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2694
	( 64  64  64)   'gray25'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2695
	( 66  66  66)   'gray26'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2696
	( 69  69  69)   'gray27'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2697
	( 71  71  71)   'gray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2698
	( 74  74  74)   'gray29'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2699
	(  8   8   8)   'gray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2700
	( 77  77  77)   'gray30'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2701
	( 79  79  79)   'gray31'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2702
	( 82  82  82)   'gray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2703
	( 84  84  84)   'gray33'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2704
	( 87  87  87)   'gray34'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2705
	( 89  89  89)   'gray35'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2706
	( 92  92  92)   'gray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2707
	( 94  94  94)   'gray37'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2708
	( 97  97  97)   'gray38'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2709
	( 99  99  99)   'gray39'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2710
	( 10  10  10)   'gray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2711
	(102 102 102)   'gray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2712
	(105 105 105)   'gray41'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2713
	(107 107 107)   'gray42'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2714
	(110 110 110)   'gray43'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2715
	(112 112 112)   'gray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2716
	(115 115 115)   'gray45'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2717
	(117 117 117)   'gray46'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2718
	(120 120 120)   'gray47'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2719
	(122 122 122)   'gray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2720
	(125 125 125)   'gray49'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2721
	( 13  13  13)   'gray5'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2722
	(127 127 127)   'gray50'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2723
	(130 130 130)   'gray51'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2724
	(133 133 133)   'gray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2725
	(135 135 135)   'gray53'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2726
	(138 138 138)   'gray54'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2727
	(140 140 140)   'gray55'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2728
	(143 143 143)   'gray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2729
	(145 145 145)   'gray57'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2730
	(148 148 148)   'gray58'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2731
	(150 150 150)   'gray59'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2732
	( 15  15  15)   'gray6'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2733
	(153 153 153)   'gray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2734
	(156 156 156)   'gray61'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2735
	(158 158 158)   'gray62'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2736
	(161 161 161)   'gray63'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2737
	(163 163 163)   'gray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2738
	(166 166 166)   'gray65'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2739
	(168 168 168)   'gray66'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2740
	(171 171 171)   'gray67'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2741
	(173 173 173)   'gray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2742
	(176 176 176)   'gray69'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2743
	( 18  18  18)   'gray7'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2744
	(179 179 179)   'gray70'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2745
	(181 181 181)   'gray71'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2746
	(184 184 184)   'gray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2747
	(186 186 186)   'gray73'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2748
	(189 189 189)   'gray74'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2749
	(191 191 191)   'gray75'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2750
	(194 194 194)   'gray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2751
	(196 196 196)   'gray77'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2752
	(199 199 199)   'gray78'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2753
	(201 201 201)   'gray79'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2754
	( 20  20  20)   'gray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2755
	(204 204 204)   'gray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2756
	(207 207 207)   'gray81'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2757
	(209 209 209)   'gray82'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2758
	(212 212 212)   'gray83'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2759
	(214 214 214)   'gray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2760
	(217 217 217)   'gray85'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2761
	(219 219 219)   'gray86'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2762
	(222 222 222)   'gray87'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2763
	(224 224 224)   'gray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2764
	(227 227 227)   'gray89'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2765
	( 23  23  23)   'gray9'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2766
	(229 229 229)   'gray90'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2767
	(232 232 232)   'gray91'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2768
	(235 235 235)   'gray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2769
	(237 237 237)   'gray93'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2770
	(240 240 240)   'gray94'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2771
	(242 242 242)   'gray95'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2772
	(245 245 245)   'gray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2773
	(247 247 247)   'gray97'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2774
	(250 250 250)   'gray98'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2775
	(252 252 252)   'gray99'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2776
	(  0 255   0)   'green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2777
	(173 255  47)   'green yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2778
	(  0 255   0)   'green1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2779
	(  0 238   0)   'green2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2780
	(  0 205   0)   'green3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2781
	(  0 139   0)   'green4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2782
	(173 255  47)   'GreenYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2783
	(240 255 240)   'honeydew'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2784
	(240 255 240)   'honeydew1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2785
	(224 238 224)   'honeydew2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2786
	(193 205 193)   'honeydew3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2787
	(131 139 131)   'honeydew4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2788
	(255 105 180)   'hot pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2789
	(255 105 180)   'HotPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2790
	(255 110 180)   'HotPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2791
	(238 106 167)   'HotPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2792
	(205  96 144)   'HotPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2793
	(139  58  98)   'HotPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2794
	(205  92  92)   'indian red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2795
	(205  92  92)   'IndianRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2796
	(255 106 106)   'IndianRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2797
	(238  99  99)   'IndianRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2798
	(205  85  85)   'IndianRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2799
	(139  58  58)   'IndianRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2800
	(255 255 240)   'ivory'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2801
	(255 255 240)   'ivory1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2802
	(238 238 224)   'ivory2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2803
	(205 205 193)   'ivory3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2804
	(139 139 131)   'ivory4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2805
	(240 230 140)   'khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2806
	(255 246 143)   'khaki1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2807
	(238 230 133)   'khaki2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2808
	(205 198 115)   'khaki3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2809
	(139 134  78)   'khaki4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2810
	(230 230 250)   'lavender'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2811
	(255 240 245)   'lavender blush'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2812
	(255 240 245)   'LavenderBlush'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2813
	(255 240 245)   'LavenderBlush1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2814
	(238 224 229)   'LavenderBlush2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2815
	(205 193 197)   'LavenderBlush3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2816
	(139 131 134)   'LavenderBlush4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2817
	(124 252   0)   'lawn green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2818
	(124 252   0)   'LawnGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2819
	(255 250 205)   'lemon chiffon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2820
	(255 250 205)   'LemonChiffon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2821
	(255 250 205)   'LemonChiffon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2822
	(238 233 191)   'LemonChiffon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2823
	(205 201 165)   'LemonChiffon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2824
	(139 137 112)   'LemonChiffon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2825
	(173 216 230)   'light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2826
	(240 128 128)   'light coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2827
	(224 255 255)   'light cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2828
	(238 221 130)   'light goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2829
	(250 250 210)   'light goldenrod yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2830
	(211 211 211)   'light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2831
	(144 238 144)   'light green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2832
	(211 211 211)   'light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2833
	(255 182 193)   'light pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2834
	(255 160 122)   'light salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2835
	( 32 178 170)   'light sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2836
	(135 206 250)   'light sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2837
	(132 112 255)   'light slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2838
	(119 136 153)   'light slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2839
	(119 136 153)   'light slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2840
	(176 196 222)   'light steel blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2841
	(255 255 224)   'light yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2842
	(173 216 230)   'LightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2843
	(191 239 255)   'LightBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2844
	(178 223 238)   'LightBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2845
	(154 192 205)   'LightBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2846
	(104 131 139)   'LightBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2847
	(240 128 128)   'LightCoral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2848
	(224 255 255)   'LightCyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2849
	(224 255 255)   'LightCyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2850
	(209 238 238)   'LightCyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2851
	(180 205 205)   'LightCyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2852
	(122 139 139)   'LightCyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2853
	(238 221 130)   'LightGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2854
	(255 236 139)   'LightGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2855
	(238 220 130)   'LightGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2856
	(205 190 112)   'LightGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2857
	(139 129  76)   'LightGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2858
	(250 250 210)   'LightGoldenrodYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2859
	(211 211 211)   'LightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2860
	(144 238 144)   'LightGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2861
	(211 211 211)   'LightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2862
	(255 182 193)   'LightPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2863
	(255 174 185)   'LightPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2864
	(238 162 173)   'LightPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2865
	(205 140 149)   'LightPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2866
	(139  95 101)   'LightPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2867
	(255 160 122)   'LightSalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2868
	(255 160 122)   'LightSalmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2869
	(238 149 114)   'LightSalmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2870
	(205 129  98)   'LightSalmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2871
	(139  87  66)   'LightSalmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2872
	( 32 178 170)   'LightSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2873
	(135 206 250)   'LightSkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2874
	(176 226 255)   'LightSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2875
	(164 211 238)   'LightSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2876
	(141 182 205)   'LightSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2877
	( 96 123 139)   'LightSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2878
	(132 112 255)   'LightSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2879
	(119 136 153)   'LightSlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2880
	(119 136 153)   'LightSlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2881
	(176 196 222)   'LightSteelBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2882
	(202 225 255)   'LightSteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2883
	(188 210 238)   'LightSteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2884
	(162 181 205)   'LightSteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2885
	(110 123 139)   'LightSteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2886
	(255 255 224)   'LightYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2887
	(255 255 224)   'LightYellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2888
	(238 238 209)   'LightYellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2889
	(205 205 180)   'LightYellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2890
	(139 139 122)   'LightYellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2891
	( 50 205  50)   'lime green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2892
	( 50 205  50)   'LimeGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2893
	(250 240 230)   'linen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2894
	(255   0 255)   'magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2895
	(255   0 255)   'magenta1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2896
	(238   0 238)   'magenta2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2897
	(205   0 205)   'magenta3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2898
	(139   0 139)   'magenta4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2899
	(176  48  96)   'maroon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2900
	(255  52 179)   'maroon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2901
	(238  48 167)   'maroon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2902
	(205  41 144)   'maroon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2903
	(139  28  98)   'maroon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2904
	(102 205 170)   'medium aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2905
	(  0   0 205)   'medium blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2906
	(186  85 211)   'medium orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2907
	(147 112 219)   'medium purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2908
	( 60 179 113)   'medium sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2909
	(123 104 238)   'medium slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2910
	(  0 250 154)   'medium spring green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2911
	( 72 209 204)   'medium turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2912
	(199  21 133)   'medium violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2913
	(102 205 170)   'MediumAquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2914
	(  0   0 205)   'MediumBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2915
	(186  85 211)   'MediumOrchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2916
	(224 102 255)   'MediumOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2917
	(209  95 238)   'MediumOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2918
	(180  82 205)   'MediumOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2919
	(122  55 139)   'MediumOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2920
	(147 112 219)   'MediumPurple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2921
	(171 130 255)   'MediumPurple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2922
	(159 121 238)   'MediumPurple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2923
	(137 104 205)   'MediumPurple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2924
	( 93  71 139)   'MediumPurple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2925
	( 60 179 113)   'MediumSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2926
	(123 104 238)   'MediumSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2927
	(  0 250 154)   'MediumSpringGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2928
	( 72 209 204)   'MediumTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2929
	(199  21 133)   'MediumVioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2930
	( 25  25 112)   'midnight blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2931
	( 25  25 112)   'MidnightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2932
	(245 255 250)   'mint cream'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2933
	(245 255 250)   'MintCream'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2934
	(255 228 225)   'misty rose'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2935
	(255 228 225)   'MistyRose'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2936
	(255 228 225)   'MistyRose1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2937
	(238 213 210)   'MistyRose2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2938
	(205 183 181)   'MistyRose3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2939
	(139 125 123)   'MistyRose4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2940
	(255 228 181)   'moccasin'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2941
	(255 222 173)   'navajo white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2942
	(255 222 173)   'NavajoWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2943
	(255 222 173)   'NavajoWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2944
	(238 207 161)   'NavajoWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2945
	(205 179 139)   'NavajoWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2946
	(139 121  94)   'NavajoWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2947
	(  0   0 128)   'navy'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2948
	(  0   0 128)   'navy blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2949
	(  0   0 128)   'NavyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2950
	(253 245 230)   'old lace'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2951
	(253 245 230)   'OldLace'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2952
	(107 142  35)   'olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2953
	(107 142  35)   'OliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2954
	(192 255  62)   'OliveDrab1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2955
	(179 238  58)   'OliveDrab2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2956
	(154 205  50)   'OliveDrab3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2957
	(105 139  34)   'OliveDrab4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2958
	(255 165   0)   'orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2959
	(255  69   0)   'orange red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2960
	(255 165   0)   'orange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2961
	(238 154   0)   'orange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2962
	(205 133   0)   'orange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2963
	(139  90   0)   'orange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2964
	(255  69   0)   'OrangeRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2965
	(255  69   0)   'OrangeRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2966
	(238  64   0)   'OrangeRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2967
	(205  55   0)   'OrangeRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2968
	(139  37   0)   'OrangeRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2969
	(218 112 214)   'orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2970
	(255 131 250)   'orchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2971
	(238 122 233)   'orchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2972
	(205 105 201)   'orchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2973
	(139  71 137)   'orchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2974
	(238 232 170)   'pale goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2975
	(152 251 152)   'pale green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2976
	(175 238 238)   'pale turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2977
	(219 112 147)   'pale violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2978
	(238 232 170)   'PaleGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2979
	(152 251 152)   'PaleGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2980
	(154 255 154)   'PaleGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2981
	(144 238 144)   'PaleGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2982
	(124 205 124)   'PaleGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2983
	( 84 139  84)   'PaleGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2984
	(175 238 238)   'PaleTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2985
	(187 255 255)   'PaleTurquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2986
	(174 238 238)   'PaleTurquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2987
	(150 205 205)   'PaleTurquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2988
	(102 139 139)   'PaleTurquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2989
	(219 112 147)   'PaleVioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2990
	(255 130 171)   'PaleVioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2991
	(238 121 159)   'PaleVioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2992
	(205 104 137)   'PaleVioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2993
	(139  71  93)   'PaleVioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2994
	(255 239 213)   'papaya whip'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2995
	(255 239 213)   'PapayaWhip'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2996
	(255 218 185)   'peach puff'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2997
	(255 218 185)   'PeachPuff'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2998
	(255 218 185)   'PeachPuff1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2999
	(238 203 173)   'PeachPuff2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3000
	(205 175 149)   'PeachPuff3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3001
	(139 119 101)   'PeachPuff4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3002
	(205 133  63)   'peru'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3003
	(255 192 203)   'pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3004
	(255 181 197)   'pink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3005
	(238 169 184)   'pink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3006
	(205 145 158)   'pink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3007
	(139  99 108)   'pink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3008
	(221 160 221)   'plum'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3009
	(255 187 255)   'plum1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3010
	(238 174 238)   'plum2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3011
	(205 150 205)   'plum3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3012
	(139 102 139)   'plum4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3013
	(176 224 230)   'powder blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3014
	(176 224 230)   'PowderBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3015
	(160  32 240)   'purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3016
	(155  48 255)   'purple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3017
	(145  44 238)   'purple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3018
	(125  38 205)   'purple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3019
	( 85  26 139)   'purple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3020
	(255   0   0)   'red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3021
	(255   0   0)   'red1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3022
	(238   0   0)   'red2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3023
	(205   0   0)   'red3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3024
	(139   0   0)   'red4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3025
	(188 143 143)   'rosy brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3026
	(188 143 143)   'RosyBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3027
	(255 193 193)   'RosyBrown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3028
	(238 180 180)   'RosyBrown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3029
	(205 155 155)   'RosyBrown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3030
	(139 105 105)   'RosyBrown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3031
	( 65 105 225)   'royal blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3032
	( 65 105 225)   'RoyalBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3033
	( 72 118 255)   'RoyalBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3034
	( 67 110 238)   'RoyalBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3035
	( 58  95 205)   'RoyalBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3036
	( 39  64 139)   'RoyalBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3037
	(139  69  19)   'saddle brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3038
	(139  69  19)   'SaddleBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3039
	(250 128 114)   'salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3040
	(255 140 105)   'salmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3041
	(238 130  98)   'salmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3042
	(205 112  84)   'salmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3043
	(139  76  57)   'salmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3044
	(244 164  96)   'sandy brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3045
	(244 164  96)   'SandyBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3046
	( 255 206 137)   'scoActiveBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3047
	( 43  45  49)   'scoActiveForeground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3048
	( 254 222 255)   'scoActiveTopShadow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3049
	( 172 186 204)   'scoAltBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3050
	( 203 203 192)   'scoBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3051
	( 11   0 113)   'scoForeground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3052
	( 141 178 215)   'scoHighlight'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3053
	( 255 240 248)   'scoTopShadow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3054
	( 46 139  87)   'sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3055
	( 46 139  87)   'SeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3056
	( 84 255 159)   'SeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3057
	( 78 238 148)   'SeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3058
	( 67 205 128)   'SeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3059
	( 46 139  87)   'SeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3060
	(255 245 238)   'seashell'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3061
	(255 245 238)   'seashell1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3062
	(238 229 222)   'seashell2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3063
	(205 197 191)   'seashell3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3064
	(139 134 130)   'seashell4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3065
	(142 56 142)   'sgi beet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3066
	(197 193 170)   'sgi bright gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3067
	(197 193 170)   'sgi bright grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3068
	(113 198 113)   'sgi chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3069
	( 85  85  85)   'sgi dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3070
	( 85  85  85)   'sgi dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3071
	(  0   0   0)   'sgi gray 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3072
	(255 255 255)   'sgi gray 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3073
	( 30  30  30)   'sgi gray 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3074
	( 40  40  40)   'sgi gray 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3075
	( 51  51  51)   'sgi gray 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3076
	( 61  61  61)   'sgi gray 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3077
	( 71  71  71)   'sgi gray 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3078
	( 81  81  81)   'sgi gray 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3079
	( 91  91  91)   'sgi gray 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3080
	( 10  10  10)   'sgi gray 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3081
	(102 102 102)   'sgi gray 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3082
	(112 112 112)   'sgi gray 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3083
	(122 122 122)   'sgi gray 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3084
	(132 132 132)   'sgi gray 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3085
	(142 142 142)   'sgi gray 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3086
	(153 153 153)   'sgi gray 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3087
	(163 163 163)   'sgi gray 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3088
	(173 173 173)   'sgi gray 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3089
	(183 183 183)   'sgi gray 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3090
	(193 193 193)   'sgi gray 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3091
	( 20  20  20)   'sgi gray 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3092
	(204 204 204)   'sgi gray 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3093
	(214 214 214)   'sgi gray 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3094
	(224 224 224)   'sgi gray 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3095
	(234 234 234)   'sgi gray 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3096
	(244 244 244)   'sgi gray 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3097
	(  0   0   0)   'sgi grey 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3098
	(255 255 255)   'sgi grey 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3099
	( 30  30  30)   'sgi grey 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3100
	( 40  40  40)   'sgi grey 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3101
	( 51  51  51)   'sgi grey 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3102
	( 61  61  61)   'sgi grey 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3103
	( 71  71  71)   'sgi grey 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3104
	( 81  81  81)   'sgi grey 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3105
	( 91  91  91)   'sgi grey 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3106
	( 10  10  10)   'sgi grey 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3107
	(102 102 102)   'sgi grey 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3108
	(112 112 112)   'sgi grey 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3109
	(122 122 122)   'sgi grey 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3110
	(132 132 132)   'sgi grey 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3111
	(142 142 142)   'sgi grey 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3112
	(153 153 153)   'sgi grey 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3113
	(163 163 163)   'sgi grey 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3114
	(173 173 173)   'sgi grey 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3115
	(183 183 183)   'sgi grey 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3116
	(193 193 193)   'sgi grey 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3117
	( 20  20  20)   'sgi grey 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3118
	(204 204 204)   'sgi grey 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3119
	(214 214 214)   'sgi grey 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3120
	(224 224 224)   'sgi grey 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3121
	(234 234 234)   'sgi grey 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3122
	(244 244 244)   'sgi grey 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3123
	(125 158 192)   'sgi light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3124
	(170 170 170)   'sgi light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3125
	(170 170 170)   'sgi light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3126
	(132 132 132)   'sgi medium gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3127
	(132 132 132)   'sgi medium grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3128
	(142 142  56)   'sgi olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3129
	(198 113 113)   'sgi salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3130
	(113 113 198)   'sgi slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3131
	( 56 142 142)   'sgi teal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3132
	( 40  40  40)   'sgi very dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3133
	( 40  40  40)   'sgi very dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3134
	(214 214 214)   'sgi very light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3135
	(214 214 214)   'sgi very light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3136
	(142 56 142)   'SGIBeet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3137
	(197 193 170)   'SGIBrightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3138
	(197 193 170)   'SGIBrightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3139
	(113 198 113)   'SGIChartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3140
	( 85  85  85)   'SGIDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3141
	( 85  85  85)   'SGIDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3142
	(  0   0   0)   'SGIGray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3143
	(255 255 255)   'SGIGray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3144
	( 30  30  30)   'SGIGray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3145
	( 40  40  40)   'SGIGray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3146
	( 51  51  51)   'SGIGray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3147
	( 61  61  61)   'SGIGray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3148
	( 71  71  71)   'SGIGray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3149
	( 81  81  81)   'SGIGray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3150
	( 91  91  91)   'SGIGray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3151
	( 10  10  10)   'SGIGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3152
	(102 102 102)   'SGIGray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3153
	(112 112 112)   'SGIGray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3154
	(122 122 122)   'SGIGray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3155
	(132 132 132)   'SGIGray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3156
	(142 142 142)   'SGIGray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3157
	(153 153 153)   'SGIGray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3158
	(163 163 163)   'SGIGray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3159
	(173 173 173)   'SGIGray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3160
	(183 183 183)   'SGIGray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3161
	(193 193 193)   'SGIGray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3162
	( 20  20  20)   'SGIGray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3163
	(204 204 204)   'SGIGray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3164
	(214 214 214)   'SGIGray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3165
	(224 224 224)   'SGIGray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3166
	(234 234 234)   'SGIGray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3167
	(244 244 244)   'SGIGray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3168
	(  0   0   0)   'SGIGrey0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3169
	(255 255 255)   'SGIGrey100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3170
	( 30  30  30)   'SGIGrey12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3171
	( 40  40  40)   'SGIGrey16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3172
	( 51  51  51)   'SGIGrey20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3173
	( 61  61  61)   'SGIGrey24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3174
	( 71  71  71)   'SGIGrey28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3175
	( 81  81  81)   'SGIGrey32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3176
	( 91  91  91)   'SGIGrey36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3177
	( 10  10  10)   'SGIGrey4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3178
	(102 102 102)   'SGIGrey40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3179
	(112 112 112)   'SGIGrey44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3180
	(122 122 122)   'SGIGrey48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3181
	(132 132 132)   'SGIGrey52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3182
	(142 142 142)   'SGIGrey56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3183
	(153 153 153)   'SGIGrey60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3184
	(163 163 163)   'SGIGrey64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3185
	(173 173 173)   'SGIGrey68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3186
	(183 183 183)   'SGIGrey72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3187
	(193 193 193)   'SGIGrey76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3188
	( 20  20  20)   'SGIGrey8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3189
	(204 204 204)   'SGIGrey80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3190
	(214 214 214)   'SGIGrey84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3191
	(224 224 224)   'SGIGrey88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3192
	(234 234 234)   'SGIGrey92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3193
	(244 244 244)   'SGIGrey96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3194
	(125 158 192)   'SGILightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3195
	(170 170 170)   'SGILightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3196
	(170 170 170)   'SGILightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3197
	(132 132 132)   'SGIMediumGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3198
	(132 132 132)   'SGIMediumGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3199
	(142 142  56)   'SGIOliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3200
	(198 113 113)   'SGISalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3201
	(113 113 198)   'SGISlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3202
	( 56 142 142)   'SGITeal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3203
	( 40  40  40)   'SGIVeryDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3204
	( 40  40  40)   'SGIVeryDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3205
	(214 214 214)   'SGIVeryLightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3206
	(214 214 214)   'SGIVeryLightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3207
	(160  82  45)   'sienna'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3208
	(255 130  71)   'sienna1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3209
	(238 121  66)   'sienna2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3210
	(205 104  57)   'sienna3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3211
	(139  71  38)   'sienna4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3212
	(135 206 235)   'sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3213
	(135 206 235)   'SkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3214
	(135 206 255)   'SkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3215
	(126 192 238)   'SkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3216
	(108 166 205)   'SkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3217
	( 74 112 139)   'SkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3218
	(106  90 205)   'slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3219
	(112 128 144)   'slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3220
	(112 128 144)   'slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3221
	(106  90 205)   'SlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3222
	(131 111 255)   'SlateBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3223
	(122 103 238)   'SlateBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3224
	(105  89 205)   'SlateBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3225
	( 71  60 139)   'SlateBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3226
	(112 128 144)   'SlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3227
	(198 226 255)   'SlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3228
	(185 211 238)   'SlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3229
	(159 182 205)   'SlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3230
	(108 123 139)   'SlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3231
	(112 128 144)   'SlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3232
	(255 250 250)   'snow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3233
	(255 250 250)   'snow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3234
	(238 233 233)   'snow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3235
	(205 201 201)   'snow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3236
	(139 137 137)   'snow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3237
	(  0 255 127)   'spring green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3238
	(  0 255 127)   'SpringGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3239
	(  0 255 127)   'SpringGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3240
	(  0 238 118)   'SpringGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3241
	(  0 205 102)   'SpringGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3242
	(  0 139  69)   'SpringGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3243
	( 70 130 180)   'steel blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3244
	( 70 130 180)   'SteelBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3245
	( 99 184 255)   'SteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3246
	( 92 172 238)   'SteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3247
	( 79 148 205)   'SteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3248
	( 54 100 139)   'SteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3249
	(210 180 140)   'tan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3250
	(255 165  79)   'tan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3251
	(238 154  73)   'tan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3252
	(205 133  63)   'tan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3253
	(139  90  43)   'tan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3254
	(216 191 216)   'thistle'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3255
	(255 225 255)   'thistle1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3256
	(238 210 238)   'thistle2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3257
	(205 181 205)   'thistle3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3258
	(139 123 139)   'thistle4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3259
	(255  99  71)   'tomato'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3260
	(255  99  71)   'tomato1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3261
	(238  92  66)   'tomato2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3262
	(205  79  57)   'tomato3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3263
	(139  54  38)   'tomato4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3264
	( 64 224 208)   'turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3265
	(  0 245 255)   'turquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3266
	(  0 229 238)   'turquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3267
	(  0 197 205)   'turquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3268
	(  0 134 139)   'turquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3269
	(238 130 238)   'violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3270
	(208  32 144)   'violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3271
	(208  32 144)   'VioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3272
	(255  62 150)   'VioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3273
	(238  58 140)   'VioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3274
	(205  50 120)   'VioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3275
	(139  34  82)   'VioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3276
	(245 222 179)   'wheat'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3277
	(255 231 186)   'wheat1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3278
	(238 216 174)   'wheat2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3279
	(205 186 150)   'wheat3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3280
	(139 126 102)   'wheat4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3281
	(255 255 255)   'white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3282
	(245 245 245)   'white smoke'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3283
	(245 245 245)   'WhiteSmoke'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3284
	(255 255   0)   'yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3285
	(154 205  50)   'yellow green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3286
	(255 255   0)   'yellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3287
	(238 238   0)   'yellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3288
	(205 205   0)   'yellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3289
	(139 139   0)   'yellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3290
	(154 205  50)   'YellowGreen'   
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3291
    ) pairWiseDo:[ :value :name |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3292
	StandardColorValues at:name put:value
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3293
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3294
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3295
     WinWorkstation initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3296
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3297
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3298
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3299
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3300
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3301
nativeWindows:aBoolean
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3302
    "enable / disable use of native windows"
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3303
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3304
    NativeWindows := aBoolean
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3305
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3306
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3307
!WinWorkstation class methodsFor:'error handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3308
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3309
debug:aBoolean
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3310
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3311
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3312
    __debug__ = (aBoolean == true) ? 1 : 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3313
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3314
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3315
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3316
prim
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3317
   "show prim values"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3318
   
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3319
   ('WINWORKSTATION: pW=',self primWindows printString,'pB=',self primBitmaps printString,'pGc=',self primgcData printString,'pbmpdc=',self primBmpDc printString) errorPrintNL
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3320
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3321
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3322
primBitmaps
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3323
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3324
    RETURN ( __MKSMALLINT(__cnt_bitmap));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3325
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3326
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3327
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3328
primBmpDc
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3329
%{  /* NOCONTEXT */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3330
    RETURN ( __MKSMALLINT(__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3331
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3332
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3333
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3334
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3335
primWindows
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3336
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3337
    RETURN ( __MKSMALLINT(__cnt_createWindows));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3338
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3339
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3340
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3341
primgcData
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3342
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3343
    RETURN ( __MKSMALLINT(__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3344
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3345
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3346
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3347
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3348
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3349
!WinWorkstation class methodsFor:'queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3350
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3351
getSystemMetrics:aSymbol
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3352
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3353
    int info = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3354
    int isBool = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3355
    int arg;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3356
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3357
    if (aSymbol == @symbol(swapButton)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3358
	arg = SM_SWAPBUTTON;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3359
	isBool = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3360
    } else if (aSymbol == @symbol(mouseButtons)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3361
	arg = SM_CMOUSEBUTTONS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3362
    } else if (aSymbol == @symbol(iconWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3363
	arg = SM_CXICON;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3364
    } else if (aSymbol == @symbol(iconHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3365
	arg = SM_CYICON;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3366
    } else if (aSymbol == @symbol(cursorWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3367
	arg = SM_CXCURSOR;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3368
    } else if (aSymbol == @symbol(cursorHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3369
	arg = SM_CYCURSOR;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3370
    } else if (aSymbol == @symbol(captionHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3371
	arg = SM_CYCAPTION;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3372
    } else if (aSymbol == @symbol(resizeFrameWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3373
	arg = SM_CXFRAME;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3374
    } else if (aSymbol == @symbol(resizeFrameHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3375
	arg = SM_CYFRAME;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3376
    } else if (aSymbol == @symbol(borderFrameWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3377
	arg = SM_CXBORDER;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3378
    } else if (aSymbol == @symbol(borderFrameHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3379
	arg = SM_CYBORDER;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3380
    } else if (aSymbol == @symbol(fullScreenWindowWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3381
	arg = SM_CXFULLSCREEN;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3382
    } else if (aSymbol == @symbol(fullScreenWindowHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3383
	arg = SM_CYFULLSCREEN;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3384
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3385
	RETURN (nil);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3386
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3387
    info = GetSystemMetrics(arg);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3388
    if (isBool) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3389
	RETURN (info ? true : false);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3390
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3391
    RETURN (__MKSMALLINT(info));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3392
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3393
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3394
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3395
platformName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3396
    "ST-80 compatibility.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3397
     Return a string describing the display systems platform."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3398
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3399
    ^ 'WIN32'  
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3400
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3401
    "Modified: 26.5.1996 / 15:32:46 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3402
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3403
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3404
!WinWorkstation methodsFor:'accessing & queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3405
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3406
anyButtonMotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3407
    "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
  3408
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3409
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3410
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3411
    RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3412
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3413
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3414
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3415
blackpixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3416
    "return the colornumber of black"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3417
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3418
    ^ blackpixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3419
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3420
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3421
button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3422
    "return the state-mask for button1 in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3423
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3424
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3425
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3426
    RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3427
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3428
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3429
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3430
     Display button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3431
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3432
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3433
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3434
button2MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3435
    "return the state-mask for button2 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3436
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3437
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3438
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3439
    RETURN (__MKSMALLINT(Button2MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3440
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3441
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3442
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3443
button3MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3444
    "return the state-mask for button3 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3445
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3446
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3447
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3448
    RETURN (__MKSMALLINT(Button3MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3449
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3450
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3451
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3452
buttonMotionMask:aButton
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3453
    "return the state-mask for button1 in motion events state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3454
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3455
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3456
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3457
    if (aButton == __MKSMALLINT(1)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3458
	RETURN (__MKSMALLINT(Button1MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3459
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3460
    if (aButton == __MKSMALLINT(2)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3461
	RETURN (__MKSMALLINT(Button2MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3462
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3463
    if (aButton == __MKSMALLINT(3)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3464
	RETURN (__MKSMALLINT(Button3MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3465
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3466
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3467
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3468
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3469
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3470
controlMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3471
    "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
  3472
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3473
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3474
    RETURN (__MKSMALLINT(ControlMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3475
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3476
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3477
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3478
defaultEventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3479
    "return a mask to enable some events by default."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3480
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3481
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3482
    RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3483
			 KeyPressMask | KeyReleaseMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3484
			 EnterWindowMask | LeaveWindowMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3485
			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3486
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3487
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3488
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3489
displayFileDescriptor
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3490
    "return the displays fileNumber for select, if any"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3491
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3492
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3493
   /* RETURN (nil);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3494
   RETURN ( __MKEXTERNALADDRESS(hInputEvent));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3495
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3496
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3497
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3498
displayName
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3499
    "return the display-connections display name.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3500
     For Windows, a dummy name is returned"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3501
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3502
    ^ 'local'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3503
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3504
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3505
getSystemColor:aKey
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3506
    |rgb|
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3507
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3508
    rgb := self primGetSystemColor:aKey.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3509
    rgb notNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3510
	^ Color
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3511
	    redByte:((rgb bitShift:-16) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3512
	    greenByte:((rgb bitShift:-8) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3513
	    blueByte:(rgb bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3514
    ].
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3515
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3516
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3517
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3518
primGetSystemColor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3519
%{  /* xxLIMITEDSTACK (WIN95 only) */
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3520
    int p;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3521
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3522
    if (aKey == @symbol(COLOR_WINDOW)) {
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3523
	p = COLOR_WINDOW;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3524
    } else if (aKey == @symbol(COLOR_WINDOWTEXT)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3525
	p = COLOR_WINDOWTEXT;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3526
    } else if (aKey == @symbol(COLOR_MENU)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3527
	p = COLOR_MENU;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3528
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3529
	p = COLOR_MENUTEXT;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3530
    } else if (aKey == @symbol(COLOR_BTNFACE)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3531
	p = COLOR_BTNFACE;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3532
    } else if (aKey == @symbol(COLOR_BTNSHADOW)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3533
	p = COLOR_BTNSHADOW;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3534
    } else if (aKey == @symbol(COLOR_BTNTEXT)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3535
	p = COLOR_BTNTEXT;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3536
    } else if (aKey == @symbol(COLOR_GRAYTEXT)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3537
	p = COLOR_GRAYTEXT;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3538
    } else if (aKey == @symbol(COLOR_HIGHLIGHT)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3539
	p = COLOR_HIGHLIGHT;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3540
    } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3541
	p = COLOR_HIGHLIGHTTEXT;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3542
    } else if (aKey == @symbol(COLOR_MENU)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3543
	p = COLOR_MENU;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3544
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3545
	p = COLOR_MENUTEXT;
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3546
    } else if (aKey == @symbol(COLOR_SCROLLBAR)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3547
	p = COLOR_SCROLLBAR;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  3548
#ifdef COLOR_SHADOW
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3549
    } else if (aKey == @symbol(COLOR_SHADOW)) {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3550
	p = COLOR_SHADOW;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  3551
#endif
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3552
    } else {
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3553
	RETURN (nil);
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3554
    }
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3555
    RETURN (__MKSMALLINT(GetSysColor(p)));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3556
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3557
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3558
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3559
primTranslatePointX:x y:y from:windowId1 to:windowId2
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3560
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3561
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3562
    HWND w1, w2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3563
    POINT point;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3564
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3565
    if (__isExternalAddress(windowId1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3566
     && __isExternalAddress(windowId2)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3567
     && __bothSmallInteger(x, y)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3568
	w1 = _HWNDVal(windowId1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3569
	w2 = _HWNDVal(windowId2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3570
	point.x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3571
	point.y = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3572
	DPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3573
	ClientToScreen(w1,&point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3574
	ScreenToClient(w2,&point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3575
	DPRINTF((" %x %d/%d\n",w2,point.x,point.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3576
	RETURN (__MKPOINT_INT(point.x, point.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3577
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3578
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3579
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3580
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3581
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3582
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3583
primViewIdFromPoint:aPoint in:windowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3584
    "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
  3585
     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
  3586
     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
  3587
     - 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
  3588
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3589
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3590
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3591
    OBJ xp, yp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3592
    int xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3593
    HWND child_return;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3594
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3595
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3596
     && __isExternalAddress(windowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3597
     && __isPoint(aPoint))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3598
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3599
	xp = _point_X(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3600
	yp = _point_Y(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3601
	if (__bothSmallInteger(xp, yp))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3602
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3603
	    POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3604
	    HWND hWnd = _HWNDVal(windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3605
	    p.x = __intVal(xp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3606
	    p.y = __intVal(yp);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3607
	    ScreenToClient(hWnd, &p);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3608
	    child_return = ChildWindowFromPointEx(hWnd,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3609
	    /*printf("ChildWindow From %x Point %d.%d = %x\n",hWnd,p.x,p.y,child_return);*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3610
	    if ((child_return) && (child_return != hWnd))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3611
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3612
		RETURN ( __MKEXTERNALADDRESS(child_return) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3613
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3614
	    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3615
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3616
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3617
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3618
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3619
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3620
protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3621
    "return the displays protocol version.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3622
     For Windows, a dummy number is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3623
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3624
    ^ '1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3625
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3626
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3627
     Display protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3628
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3629
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3630
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3631
serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3632
    "return the server vendor string. 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3633
     For Windows, a dummy name is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3634
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3635
    ^ 'microsoft'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3636
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3637
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3638
     Display serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3639
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3640
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3641
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3642
shiftMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3643
    "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
  3644
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3645
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3646
    RETURN (__MKSMALLINT(ShiftMask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3647
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3648
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3649
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3650
translatePoint:aPoint from:windowId1 to:windowId2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3651
    "given a point in window1, return the coordinate in window2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3652
     This expects a device coordinate (relative to the first views origin)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3653
     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
  3654
     - use to xlate points from a window to rootwindow"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3655
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3656
    |x1 y1|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3657
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3658
    x1 := aPoint x truncated.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3659
    y1 := aPoint y truncated.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3660
    ^ self primTranslatePointX:x1 y:y1 from:windowId1 to:windowId2
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3661
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3662
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3663
vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3664
    "return the display-servers vendor release 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3665
     - should normally not be of any interest, 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3666
     but may be usefule for special cases.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3667
     (to avoid bugs in certain implementations / releases)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3668
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3669
    ^ 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3670
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3671
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3672
     Display vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3673
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3674
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3675
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3676
viewIdFromPoint:aPoint in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3677
    "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
  3678
     hit by this coordinate. Return nil if no view was hit.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3679
     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
  3680
     - used to find the window to drop objects after a cross-view drag."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3681
     
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3682
    windowId notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3683
	aPoint isPoint ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3684
	    "/(aPoint x > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3685
	    "/(aPoint y > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3686
	    "/aPoint printString errorPrintCR.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3687
	    ^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3688
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3689
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3690
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3691
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3692
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3693
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3694
whitepixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3695
    "return the colornumber of white"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3696
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3697
    ^ whitepixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3698
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3699
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3700
!WinWorkstation methodsFor:'accessing display capabilities'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3701
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3702
iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3703
    "Get the preferred/supported icon sizes."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3704
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3705
    |d|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3706
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3707
    d := IdentityDictionary new.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3708
    d at:#minWidth put:(self class getSystemMetrics:#iconWidth).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3709
    d at:#maxWidth put:(self class getSystemMetrics:#iconHeight).
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3710
    d at:#widthStep put:1.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3711
    d at:#minHeight put:(self class getSystemMetrics:#iconWidth).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3712
    d at:#maxHeight put:(self class getSystemMetrics:#iconHeight).
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3713
    d at:#heightStep put:1.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3714
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3715
    ^ OrderedCollection with:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3716
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3717
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3718
     Display iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3719
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3720
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3721
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3722
scrollsAsynchronous
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3723
    "return true, if this display asynchronously sends expose events after a
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3724
     scroll operation. False otherwise. Asynchronous expose events are an X
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3725
     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
  3726
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3727
    "/ event Handling erst verbessern 
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3728
    ^ true "/ false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3729
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3730
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3731
supportedImageFormats
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3732
    "return an array with supported image formats; each array entry
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3733
     is another array, consisting of depth and bitsPerPixel values."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3734
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3735
    |info|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3736
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3737
    info := IdentityDictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3738
    info at:#depth put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3739
    info at:#bitsPerPixel put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3740
    info at:#padding put:32.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3741
    ^ Array with:info
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3742
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3743
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3744
supportsDeepIcons
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3745
    "return true, if this device supports deepicons."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3746
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3747
    ^ true
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3748
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3749
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3750
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3751
supportsIconViews
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3752
    "return true, if this device supports views as icons."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3753
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3754
    ^ true
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3755
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3756
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3757
     Display supportsIconViews
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3758
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3759
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3760
    "Modified: 10.6.1996 / 20:11:48 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3761
    "Created: 10.6.1996 / 21:08:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3762
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3763
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3764
usableExtent
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3765
    "return the usable extent of the display (in pixels).
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3766
     Normally, the same as extent, but may be smaller, in
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3767
     case some menu space is taken up by the window manager (windows)"
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3768
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3769
    ^ (self class getSystemMetrics:#fullScreenWindowWidth)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3770
      @
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3771
      (self class getSystemMetrics:#fullScreenWindowHeight)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3772
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3773
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3774
!WinWorkstation methodsFor:'bitmap/window creation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3775
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3776
createBitmapFromArray:anArray width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3777
    |bitmapId|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3778
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3779
    bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3780
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3781
    bitmapId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3782
	'WINWORKSTATION: cannot create bitmap' errorPrintCR.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3783
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3784
    ^ bitmapId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3785
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3786
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3787
createBitmapWidth:w height:h
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3788
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3789
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3790
    HANDLE newBitmapHandle;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3791
    int b_width, b_height;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3792
/*    printf("CreateBitmap B/W\n");*/
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3793
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3794
    if (__bothSmallInteger(w, h)) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3795
	b_width = __intVal(w);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3796
	b_height = __intVal(h);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3797
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3798
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3799
	if (newBitmapHandle)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3800
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3801
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3802
	    __cnt_bitmap++;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3803
	   RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle,__cnt_bitmap));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3804
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3805
	  RETURN ( __MKOBJ(newBitmapHandle));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3806
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3807
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3808
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3809
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3810
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3811
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3812
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3813
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3814
createPixmapWidth:w height:h depth:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3815
    "allocate a pixmap on the Xserver, the contents is undefined
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3816
     (i.e. random). Return a bitmap id or nil"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3817
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3818
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3819
    HANDLE newBitmapHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3820
    /*printf("CreateBitmap Color\n");*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3821
    if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3822
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3823
	if (__intVal(d) == 1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3824
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3825
	  newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3826
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3827
	else
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3828
	{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3829
	  /*if (__intVal(d) != __depth)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3830
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3831
	    printf("invalite depth\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3832
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3833
	  } */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3834
	  newBitmapHandle = CreateCompatibleBitmap(__rootDC,__intVal(w), __intVal(h) );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3835
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3836
	if (newBitmapHandle)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3837
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3838
#ifdef COUNT_BMP_RESOURCES
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3839
	    __cnt_bitmap++;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3840
	   RES_BMP_PRINTF(("CreatePixmap %x %d\n",newBitmapHandle,__cnt_bitmap));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3841
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3842
	  RETURN ( __MKOBJ(newBitmapHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3843
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3844
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3845
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3846
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3847
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3848
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3849
1467
9629ce710c53 added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3850
createWindowFor:aView type:typeSymbol
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3851
		 origin:origin
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3852
		 extent:extent
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3853
		 minExtent:minExt
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3854
		 maxExtent:maxExt
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3855
		 borderWidth:bWidth
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3856
		 subViewOf:wsuperView
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3857
		 style:wStyle
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3858
		 inputOnly:winputOnly
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3859
		 label:wlabel
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3860
		 owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3861
		 icon:wicon
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3862
		 iconMask:wiconMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3863
		 iconView:wiconView
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3864
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3865
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3866
    |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3867
     wsuperViewId wiconId wiconMaskId windowId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3868
     weventMask wiconHeight
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3869
     wiconWidth windowType windowClass moreArgs|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3870
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3871
    "/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3872
    "/  preferredVisual preferredDepth  viewGravity wcursorId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3873
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3874
    displayId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3875
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3876
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3877
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3878
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3879
    origin notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3880
	xpos := origin x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3881
	ypos := origin y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3882
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3883
	xpos := ypos := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3884
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3885
    extent notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3886
	wwidth := extent x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3887
	wheight := extent y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3888
    ] ifFalse:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3889
	wwidth := 100.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3890
	wheight := 40.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3891
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3892
    minExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3893
	minWidth := minExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3894
	minHeight := minExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3895
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3896
    maxExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3897
	maxWidth := maxExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3898
	maxHeight := maxExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3899
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3900
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3901
    wsuperView notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3902
	wsuperViewId := wsuperView id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3903
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3904
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3905
    wicon notNil ifTrue:[
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3906
	wiconId := wicon id.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3907
	wiconHeight := wicon height.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3908
	wiconWidth  := wicon width.
1418
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  3909
	wiconMask notNil ifTrue:[
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  3910
	    wiconMaskId := wiconMask id
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  3911
	]
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3912
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3913
"/    wiconView notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3914
"/        wiconViewId := wiconView id
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3915
"/    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3916
    weventMask := aView eventMask.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3917
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3918
    NativeWindows ifTrue:[
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3919
	windowType := aView nativeWindowType.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3920
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3921
	"/ if it is already a string, take it as it is;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3922
	"/ otherwise, it must be a symbol and is used
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3923
	"/ as a key into the nativeClass translation map.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3924
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3925
	windowType isString ifTrue:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3926
	    windowClass := windowType
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3927
	] ifFalse:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3928
	    windowClass := NativeWindowClassTable at:windowType ifAbsent:nil
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3929
	]
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3930
    ].
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3931
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3932
    moreArgs := Array new:20.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3933
    moreArgs at:1 put:xpos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3934
    moreArgs at:2 put:ypos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3935
    moreArgs at:3 put:wwidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3936
    moreArgs at:4 put:wheight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3937
    moreArgs at:5 put:minWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3938
    moreArgs at:6 put:minHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3939
    moreArgs at:7 put:maxWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3940
    moreArgs at:8 put:maxHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3941
    moreArgs at:9 put:wsuperViewId.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3942
    moreArgs at:10 put:nil. "/ wcursorId.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3943
    moreArgs at:11 put:wiconId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3944
    moreArgs at:12 put:wiconMaskId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3945
    moreArgs at:13 put:wiconWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3946
    moreArgs at:14 put:wiconHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3947
    moreArgs at:15 put:windowType.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3948
    moreArgs at:16 put:windowClass.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3949
    moreArgs at:17 put:weventMask.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3950
    moreArgs at:18 put:(aView className asString).
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3951
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3952
    [
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3953
      windowId := self
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3954
		  primCreateWindowFor:aView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3955
		  type:typeSymbol
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3956
		  borderWidth:bWidth
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3957
		  subViewOf:wsuperView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3958
		  style:wStyle
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3959
		  inputOnly:winputOnly
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3960
		  label:wlabel
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3961
		  owner:wowner
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3962
		  icon:wicon
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3963
		  iconMask:wiconMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3964
		  moreArgs:moreArgs.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3965
      aView setId:windowId.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3966
    ] valueUninterruptably.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3967
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3968
    windowId notNil ifTrue:[self addKnownView:aView withId:windowId].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3969
    ^ windowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3970
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3971
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3972
destroyGC:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3973
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3974
    if (__isExternalAddress(aGCId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3975
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3976
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3977
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3978
	__cnt_gcData--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3979
       RESPRINTF(("DestroyGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3980
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3981
       if (gcData->hBitmap) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3982
       {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3983
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3984
	    __cnt_bmpdc--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3985
	    RES_BMP_PRINTF(("free BmpDC %d\n",__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3986
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3987
       }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3988
       free(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3989
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3990
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3991
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3992
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3993
destroyPixmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3994
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3995
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3996
    if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3997
	HANDLE bitmapHandle = _HANDLEVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3998
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3999
	if (bitmapHandle)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4000
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4001
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4002
	    __cnt_bitmap--;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4003
	    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
  4004
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4005
	    if( DelObject(bitmapHandle) )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4006
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4007
		DPRINTF(("Bitmap deleted!\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4008
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4009
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4010
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4011
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4012
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4013
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4014
destroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4015
    self primDestroyView:aView withId:aWindowId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4016
    self removeKnownView:aView withId:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4017
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4018
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4019
gcFor:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4020
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4021
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4022
    HWND hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4023
    struct gcData *gcData;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4024
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4025
    if (__isExternalAddress(aDrawableId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4026
	hWnd = _HWNDVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4027
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4028
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4029
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4030
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4031
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4032
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4033
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4034
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4035
	gcData->hWnd = hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4036
	gcData->_hDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4037
	DPRINTF(("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
  4038
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4039
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4040
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4041
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4042
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4043
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4044
gcForBitmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4045
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4046
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4047
    struct gcData *gcData;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4048
    BITMAP bitmap;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4049
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4050
    if (__isExternalAddress(aDrawableId)) {  /* HBITMAP */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4051
	HBITMAP hBitmap = _HBITMAPVAL(aDrawableId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4052
	HDC hDC;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4053
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4054
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4055
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4056
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4057
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4058
	__cnt_bmpdc++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4059
	RES_BMP_PRINTF(("CreateBmpDC %d\n",__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4060
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4061
	if (GetObject(hBitmap,sizeof(bitmap),&bitmap))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4062
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4063
	    DPRINTF(("bitmap info:%d\n",bitmap.bmBitsPixel));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4064
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4065
	else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4066
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4067
	    DPRINTF(("noinfo returned\n"));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4068
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4069
        gcData->hBitmap = hBitmap;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4070
	gcData->bitmapColorBitCount = bitmap.bmBitsPixel;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4071
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4072
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4073
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4074
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4075
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4076
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4077
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4078
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4079
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4080
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4081
primCreateBitmapFromArray:anArray width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4082
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4083
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4084
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4085
    HBITMAP newBitmapHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4086
    int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding, nBytes;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4087
    int row, col;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4088
    unsigned char *cp, *bPits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4089
    unsigned char *b_bits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4090
    unsigned char *pBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4091
    int index;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4092
    OBJ num, *op;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4093
    unsigned char *allocatedBits = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4094
    unsigned char fastBits[10000];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4095
/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4096
    if (! ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4097
	RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4098
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4099
*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4100
    if (__bothSmallInteger(w, h) && _isNonNilObject(anArray))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4101
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4102
	b_width = __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4103
	b_height = __intVal(h);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4104
	bytesPerRowST = (b_width + 7) / 8;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4105
	bytesPerRowWN = ((b_width + 15) / 16) * 2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4106
	padding = bytesPerRowWN - bytesPerRowST;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4107
	nBytes = b_height * bytesPerRowWN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4108
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4109
	if (nBytes < sizeof(fastBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4110
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4111
	    cp = b_bits = fastBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4112
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4113
	else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4114
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4115
	    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
2236
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
  4116
            CPRINTF(("malloc for Bitmap\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4117
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4118
	if (cp)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4119
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4120
	  if (__qClass(anArray) == @global(Array))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4121
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4122
	      index = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4123
	      op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4124
	      for (row = b_height; row; row--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4125
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4126
		  for (col = bytesPerRowST; col; col--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4127
		  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4128
		      num = *op++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4129
		      if (! __isSmallInteger(num))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4130
			goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4131
		      *cp++ = __intVal(num);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4132
		  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4133
		  cp += padding;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4134
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4135
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4136
	  else if (__qClass(anArray) == @global(ByteArray))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4137
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4138
	      pBits = __ByteArrayInstPtr(anArray)->ba_element;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4139
	      for (row = b_height; row; row--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4140
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4141
		  for (col = bytesPerRowST; col; col--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4142
		  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4143
		      *cp++ = ( *pBits++ /*^ 0xFF*/ );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4144
		  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4145
		  cp += padding;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4146
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4147
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4148
	  else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4149
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4150
	      goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4151
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4152
	  DPRINTF(("create bitmap ...\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4153
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4154
	  newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, b_bits );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4155
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4156
	  if( newBitmapHandle )
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4157
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4158
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4159
	    __cnt_bitmap++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4160
	    RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle,__cnt_bitmap));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4161
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4162
	    DPRINTF(("returning bitmap ...\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4163
	    if (allocatedBits)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4164
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4165
	      free(allocatedBits);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4166
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4167
	    RETURN ( __MKOBJ(newBitmapHandle));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4168
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4169
      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4170
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4171
fail: ;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4172
    PRINTF(("create bitmap FAILED!!!\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4173
    if (allocatedBits)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4174
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4175
      PRINTF(("freeing up bitmap bits ...\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4176
      free(allocatedBits);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4177
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4178
    DPRINTF(("returning nil ...\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4179
    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4180
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4181
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4182
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4183
primCreateWindowFor:aView type:aSymbol
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4184
	  borderWidth:bWidth subViewOf:wsuperView
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4185
	  style:wStyle inputOnly:winputOnly
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4186
	  label:wlabel owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4187
	  icon:wicon iconMask:wiconMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4188
	  moreArgs:moreArgs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4189
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4190
%{  /* xxLIMITEDSTACK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4191
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4192
    WNDCLASS wc;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4193
    long bg, bd, bw;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  4194
    int winStyleBits, winEXStyleBits;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4195
    int w, h, x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4196
    int min_width, min_height;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4197
    int max_width, max_height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4198
    OBJ eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4199
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4200
    HANDLE parentHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4201
    OBJ xpos, ypos, wwidth, wheight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4202
    OBJ minWidth, minHeight, maxWidth, maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4203
    OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4204
    OBJ wiconWidth, wiconHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4205
    OBJ windowType, windowClass, windowId;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4206
    OBJ stClassName;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4207
    int isTopWindow = 0;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4208
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4209
    unsigned char* cp;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4210
    HBITMAP        xBitMap, maskBitmap;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4211
    int            height, width;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4212
    int            nBytes, nBits;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4213
    int            index;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4214
    HICON          xIcon = (HICON)0;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4215
    SIZE           oldSize;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4216
    ICONINFO       iconInfo;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4217
    char *className;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4218
    unsigned char *allocatedBits = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4219
    unsigned char fastBits[10000];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4220
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4221
    xpos = __ArrayInstPtr(moreArgs)->a_element[0];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4222
    ypos = __ArrayInstPtr(moreArgs)->a_element[1];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4223
    wwidth = __ArrayInstPtr(moreArgs)->a_element[2];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4224
    wheight = __ArrayInstPtr(moreArgs)->a_element[3];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4225
    minWidth = __ArrayInstPtr(moreArgs)->a_element[4];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4226
    minHeight = __ArrayInstPtr(moreArgs)->a_element[5];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4227
    maxWidth = __ArrayInstPtr(moreArgs)->a_element[6];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4228
    maxHeight = __ArrayInstPtr(moreArgs)->a_element[7];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4229
    wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4230
    wcursorId = __ArrayInstPtr(moreArgs)->a_element[9];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4231
    wiconId = __ArrayInstPtr(moreArgs)->a_element[10];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4232
    wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4233
    wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4234
    wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4235
    windowType = __ArrayInstPtr(moreArgs)->a_element[14];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4236
    windowClass = __ArrayInstPtr(moreArgs)->a_element[15];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4237
    eventMask = __ArrayInstPtr(moreArgs)->a_element[16];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4238
    stClassName = __ArrayInstPtr(moreArgs)->a_element[17];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4239
    bg = WhitePixel;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4240
    bd = BlackPixel;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4241
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4242
    /* get bitmap for icon */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4243
    if(  __isExternalAddress(wiconId) )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4244
    {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4245
	xBitMap = _HBITMAPVAL( wiconId );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4246
	if( xBitMap != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4247
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4248
	  BITMAP bm;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4249
	  if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4250
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4251
	    int d = bm.bmPlanes * bm.bmBitsPixel;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4252
	    BYTE *ep;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4253
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4254
	    DPRINTF(("Bitmap w:%d h:%d p:%d d:%d\n",bm.bmWidth,bm.bmHeight,bm.bmPlanes,bm.bmBitsPixel));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4255
	    height = __intVal( wiconHeight );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4256
	    width  = __intVal( wiconWidth  );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4257
	    nBytes = ( width + 15 ) / 16;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4258
	    nBytes = height * nBytes * 2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4259
	    if (nBytes < sizeof(fastBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4260
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4261
		ep = fastBits;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4262
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4263
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4264
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4265
		ep = allocatedBits = (unsigned char *) malloc(nBytes);
2236
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
  4266
                CPRINTF(("malloc for Bitmap1\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4267
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4268
	    if ( ep != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4269
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4270
		memset(ep,0,nBytes);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4271
		maskBitmap = CreateBitmap(width, height, 1, 1, ep );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4272
		if( maskBitmap != NULL )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4273
		{
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4274
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4275
		    iconInfo.fIcon = TRUE;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4276
		    iconInfo.hbmMask  = maskBitmap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4277
		    iconInfo.hbmColor = xBitMap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4278
		    xIcon = CreateIconIndirect( &iconInfo );
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4279
		    DPRINTF(( "ICON CREATED!!!\n" ));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4280
		    DelObject( maskBitmap );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4281
		} else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4282
		    DPRINTF(( "BITMAP mask CREATION failed!!!\n" ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4283
		}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4284
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4285
		PRINTF(( " malloc failed\n" ));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4286
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4287
            if (allocatedBits)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4288
		free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4289
	  }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4290
	} else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4291
	    DPRINTF((" xBitMap is zero \n" ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4292
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4293
    } else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4294
	if (wiconId == nil) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4295
	    DPRINTF((" wiconId is nil\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4296
	} else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4297
	    DPRINTF((" wiconId is not an external address\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4298
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4299
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4300
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4301
    if (__bothSmallInteger(wwidth, wheight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4302
	w = __intVal(wwidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4303
	h = __intVal(wheight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4304
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4305
	w = h = 100;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4306
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4307
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4308
    if (__bothSmallInteger(xpos, ypos)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4309
	x = __intVal(xpos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4310
	y = __intVal(ypos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4311
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4312
	x = y = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4313
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4314
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4315
    if (__bothSmallInteger(minWidth, minHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4316
	min_width = __intVal(minWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4317
	min_height = __intVal(minHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4318
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4319
	min_width = min_height = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4320
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4321
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4322
    if (__bothSmallInteger(maxWidth, maxHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4323
	max_width = __intVal(maxWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4324
	max_height = __intVal(maxHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4325
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4326
	max_width = max_height = 10000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4327
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4328
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  4329
    winStyleBits = winEXStyleBits = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4330
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4331
    if (__isSmallInteger(bWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4332
	bw = __intVal(bWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4333
	if (bw) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4334
	    winStyleBits |= WS_BORDER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4335
	    bw = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4336
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4337
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4338
	bw = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4339
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4340
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4341
    className = app_name;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4342
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4343
/*    if (__isString(windowClass)) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4344
	className = __stringVal(windowClass);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4345
    }
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4346
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4347
    if (__isString(windowClass)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4348
	if (__isInteger(wStyle)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4349
	    winStyleBits |= __longIntVal(wStyle);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4350
	} else {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4351
	    if (windowType == @symbol(RadioButton)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4352
		winStyleBits |= BS_RADIOBUTTON;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4353
	    } else if (windowType == @symbol(CheckBox)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4354
		winStyleBits |= BS_CHECKBOX;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4355
	    } else if (windowType == @symbol(HorizontalScrollbar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4356
		winStyleBits |= SBS_HORZ;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4357
	    } else if (windowType == @symbol(VerticalScrollBar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4358
		winStyleBits |= SBS_VERT;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4359
	    }
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4360
	}
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4361
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4362
*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4363
    if (__isExternalAddress(wsuperViewId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4364
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4365
	 * a child window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4366
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4367
	parentHandle = _HANDLEVal(wsuperViewId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4368
	winStyleBits |= WS_CHILD;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4369
	if (winputOnly != true)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4370
	{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4371
	  winStyleBits |= (WS_CLIPSIBLINGS|WS_CLIPCHILDREN);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4372
	  /*winStyleBits |= WS_CLIPCHILDREN;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4373
	  DPRINTF(("parent handle=%x\n", parentHandle));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4374
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4375
	else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4376
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4377
	  winEXStyleBits |= WS_EX_TRANSPARENT;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4378
	  DPRINTF(("inputview parent handle=%x\n", parentHandle));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4379
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4380
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4381
    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4382
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4383
	char buf[300];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4384
	char *stName;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4385
	static winCount;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4386
#   ifdef __BORLANDC__
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4387
	struct timeb timebuffer;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4388
	ftime(&timebuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4389
#   else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4390
	struct _timeb timebuffer;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4391
	_ftime(&timebuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4392
#   endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4393
	if (__isString(stClassName)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4394
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4395
	  stName = __stringVal(stClassName);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4396
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4397
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4398
	  stName = app_name;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4399
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4400
	sprintf(buf,"S%d.%d%s",HIWORD(timebuffer.time),++winCount,stName);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4401
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4402
	 * a top window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4403
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4404
	parentHandle = NULL;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4405
	isTopWindow = 1;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4406
	DPRINTF(("topview - registerClass:%s\n",buf));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4407
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4408
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4409
	wc.style = /* CS_HREDRAW | CS_VREDRAW | CS_OWNDC  |*/ CS_DBLCLKS;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4410
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4411
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4412
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4413
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4414
	if (xIcon) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4415
	    wc.hIcon   = xIcon;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4416
	    /* wc.hIconSm = wiconId; In 4.x there are large and small icons */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4417
	} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4418
	    wc.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4419
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4420
	wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4421
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4422
	wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4423
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4424
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4425
	wc.lpszClassName = buf;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4426
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4427
	if (!RegisterClass(&wc)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4428
	    PRINTF(("RegisterClass failed\n"));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4429
	    RETURN( nil );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4430
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4431
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4432
	className = buf;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4433
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4434
	if (wStyle == @symbol(popUp)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4435
	    winStyleBits |= WS_POPUP;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4436
            winStyleBits |= WS_DISABLED;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4437
            CPRINTF(("Create popUpWindow\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4438
	} else if (wStyle == @symbol(dialog)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4439
/*
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4440
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4441
*/
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4442
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | DS_MODALFRAME | WS_SYSMENU;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4443
	    if ((min_width || min_height)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4444
	     && (min_width == max_width)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4445
	     && (min_height == max_height)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4446
		winStyleBits &= ~WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4447
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4448
	} else {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4449
	    winStyleBits |= WS_OVERLAPPEDWINDOW;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  4450
	    winEXStyleBits |= WS_EX_CLIENTEDGE;
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  4451
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4452
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4453
	winStyleBits |= WS_CLIPCHILDREN;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4454
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4455
    rec.left = x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4456
    rec.top = y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4457
    rec.right = x + w;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4458
    rec.bottom = y+ h;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4459
    _thread_winStyleBitsEx = WS_EX_LEFT | WS_EX_NOPARENTNOTIFY | winEXStyleBits;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4460
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4461
    AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4462
    w = rec.right - rec.left;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4463
    h = rec.bottom - rec.top;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4464
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4465
    DPRINTF(("create%s pos==%d/%d size=%d/%d bw=%d parent %x class='%s'...\n",
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4466
		((wStyle == @symbol(popUp)) ? " popUp" : ""), x, y, w, h, bw,parentHandle, className));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4467
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4468
    /* allocate localMemory for Window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4469
    _thread_local = (localWindowInfo*)malloc(sizeof(localWindowInfo));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4470
    if (_thread_local)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4471
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4472
      memset(_thread_local,0,sizeof(*_thread_local));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4473
      if (isTopWindow)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4474
      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4475
	if (rec.left < 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4476
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4477
	  rec.left = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4478
	  rec.right = w;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4479
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4480
	if (rec.top < 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4481
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4482
	  rec.top = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4483
	  rec.bottom = h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4484
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4485
	_thread_local->flag = LI_TOPWIN;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4486
      }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4487
      if (winputOnly == true)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4488
	_thread_local->flag |= LI_INPUTWIN;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4489
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4490
      _thread_className = className;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4491
      _thread_winStyleBits = winStyleBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4492
      _thread_parentHandle = parentHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4493
      _thread_x = rec.left;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4494
      _thread_y = rec.top;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4495
      _thread_dx = rec.right - rec.left;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4496
      _thread_dy = rec.bottom - rec.top;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4497
      rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4498
      rec.top = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4499
      rec.right = min_width;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4500
      rec.bottom = min_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4501
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4502
      AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4503
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4504
      _thread_local->minWidth = rec.right - rec.left;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4505
      _thread_local->minHeight = rec.bottom - rec.top;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4506
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4507
      rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4508
      rec.top = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4509
      rec.right = max_width;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4510
      rec.bottom = max_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4511
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4512
      AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4513
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4514
      _thread_local->maxWidth = rec.right - rec.left;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4515
      _thread_local->maxHeight = rec.bottom - rec.top;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4516
      _thread_local->bgBrush = 0; /*GetStockObject(HOLLOW_BRUSH);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4517
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4518
      if (__isSmallInteger(eventMask))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4519
	_thread_local->eventMask = __intVal(eventMask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4520
      else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4521
	_thread_local->eventMask = 0xffffffff;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4522
      DPRINTF(("eventMask is %x\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4523
#ifdef DEBUGMASK1
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4524
      printMask(_thread_local->eventMask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4525
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4526
      _thread_newWinHandle = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4527
      _thread_windowName = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4528
      if (isTopWindow)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4529
      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4530
	  if (__isString(wlabel) || __isSymbol(wlabel)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4531
	      _thread_windowName = (char *) __stringVal(wlabel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4532
	      DPRINTF(("title = %s\n", _thread_windowName));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4533
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4534
      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4535
      PostThreadMessage(_dispatchThreadId,WM_THREADCREATEWINDOW,0,0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4536
      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4537
	DWORD dwWaitResult;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4538
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4539
	/* Request ownership of mutex. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4540
	dwWaitResult = WaitForSingleObject(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4541
	  hCreateEvent,   /* handle of mutex */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4542
	  15000L);   /* time-out interval */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4543
      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4544
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4545
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4546
    DPRINTF(("handle = %x\n", _thread_newWinHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4547
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4548
    if (! _thread_newWinHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4549
	DPRINTF(("handle is nil\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4550
	RETURN ( nil );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4551
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4552
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4553
    windowId = __MKOBJ(_thread_newWinHandle);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4554
    if (_thread_newWinHandle)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4555
      SetWindowPos(_thread_newWinHandle, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4556
    DPRINTF(("done - create\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4557
    RETURN (windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4558
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4559
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4560
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4561
primDestroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4562
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4563
%{  /* xxLIMITEDSTACK (WIN95 only) */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4564
    HICON yIcon;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4565
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4566
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4567
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4568
	if (win && IsWindow(win))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4569
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4570
	   yIcon = (HICON)GetClassLong(_thread_newWinHandle,GCL_HICON);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4571
	   SetClassLong(_thread_newWinHandle,GCL_HICON,(DWORD)0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4572
	   /* It has to be checked whether thia can be deleted!!!!! */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4573
	   if( yIcon )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4574
	   {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4575
		if( DestroyIcon( yIcon ) )
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4576
		    DPRINTF(( "Old icon deleted\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4577
	   }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4578
	   /*printf("post WM_THREADDESTROYWINDOW\n");*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4579
	   PostMessage(win,WM_THREADDESTROYWINDOW,0,0);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4580
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4581
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4582
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4583
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4584
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4585
rootWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4586
    "return the id of the root window.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4587
     This is the window you see as background,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4588
     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
  4589
     since some window managers install a virtual root window on top
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4590
     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
  4591
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4592
    ^ rootWin
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4593
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4594
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4595
!WinWorkstation methodsFor:'color stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4596
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4597
colorRed:redVal green:greenVal blue:blueVal
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4598
    "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
  4599
     This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4600
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4601
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4602
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4603
    r := self percentToDeviceColorValue:redVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4604
    g := self percentToDeviceColorValue:greenVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4605
    b := self percentToDeviceColorValue:blueVal.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4606
    ^ self colorScaledRed:r scaledGreen:g scaledBlue:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4607
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4608
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4609
colorScaledRed:r scaledGreen:g scaledBlue:b
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4610
    "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
  4611
     (i.e. colorID)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4612
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4613
    int id, ir, ig, ib;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4614
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4615
    if (__bothSmallInteger(r, g)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4616
     && __isSmallInteger(b))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4617
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4618
      id = RGB2st(__intVal(r),__intVal(g),__intVal(b));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4619
      DDPRINTF(("alloc color %d/%d/%d -> %x\n", ir, ig, ib, id));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4620
      RETURN ( __MKSMALLINT(id) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4621
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4622
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4623
    self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4624
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4625
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4626
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4627
freeColor:colorIndex
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4628
    "free a display color when its no longer needed"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4629
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4630
    'free color' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4631
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4632
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4633
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4634
getRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4635
    "get rgb components (0..100) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4636
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4637
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4638
    |val|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4639
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4640
    self getScaledRGBFrom:index into:[:r :g :b |
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4641
	val := aBlock
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4642
		value:(r * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4643
		value:(g * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4644
		value:(b * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4645
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4646
    'get RGB' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4647
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4648
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4649
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4650
getRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4651
    "get rgb components (0..100) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4652
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4653
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4654
    |val|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4655
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4656
    self getScaledRGBFromName:colorName into:[:r :g :b |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4657
	r isNil ifTrue:[^nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4658
	val := aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4659
		value:(r * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4660
		value:(g * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4661
		value:(b * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4662
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4663
    ^val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4664
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4665
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4666
getScaledRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4667
    "get rgb components (0 .. 16rFFFF) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4668
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4669
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4670
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4671
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4672
    int id = __intVal(index);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4673
    int iR, iG, iB;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4674
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4675
    id = st2RGB(id,0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4676
    iR = id & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4677
    iG = (id >> 8) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4678
    iB = (id >> 16) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4679
    iR = (iR << 8) | iR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4680
    iG = (iG << 8) | iG;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4681
    iB = (iB << 8) | iB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4682
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4683
    r = __MKSMALLINT(iR);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4684
    g = __MKSMALLINT(iG);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4685
    b = __MKSMALLINT(iB);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4686
    /*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
  4687
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4688
    ^ aBlock value:r value:g value:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4689
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4690
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4691
getScaledRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4692
    "get scaled rgb components (0..16rFFFF) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4693
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4694
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4695
    |triple r g b found|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4696
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4697
    r := g := b := 0.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4698
    found := false.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4699
    (colorName startsWith:$#) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4700
	"/ color in r/g/b hex notation
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4701
	r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4702
	g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4703
	b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4704
	found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4705
    ] ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4706
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4707
	triple := StandardColorValues at:colorName asString ifAbsent:nil.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4708
	triple isNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4709
	    triple := StandardColorValues at:colorName asString asLowercase ifAbsent:nil.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4710
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4711
	triple notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4712
	    r := triple at:1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4713
	    g := triple at:2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4714
	    b := triple at:3.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4715
	    found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4716
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4717
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4718
    found ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4719
	('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4720
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4721
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4722
    ^ 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
  4723
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4724
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4725
listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4726
    "return a list of all available colornames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4727
     This should not be used, since colornames are very
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4728
     display-specific (here X-specific)."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4729
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4730
    |aStream list line index colorName|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4731
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4732
    aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4733
    aStream isNil ifTrue:[^ nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4734
    list := OrderedCollection new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4735
    [aStream atEnd] whileFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4736
	line := aStream nextLine.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4737
	line notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4738
	    "skip the r/g/b numbers"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4739
	    index := 1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4740
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4741
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4742
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4743
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4744
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4745
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4746
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4747
	    colorName := line copyFrom:index.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4748
	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4749
		list add:colorName
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4750
	    ]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4751
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4752
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4753
    aStream close.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4754
    ^ list sort
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4755
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4756
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4757
     Screen current listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4758
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4759
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4760
    "Modified: 11.9.1996 / 15:26:28 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4761
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4762
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4763
percentToDeviceColorValue:aPercentage
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4764
    "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
  4765
     WIN-component value (0..16rFFFF) as an integer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4766
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4767
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4768
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4769
    if (__isSmallInteger(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4770
	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4771
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4772
    if (__isFloat(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4773
	RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4774
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4775
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4776
    ^ (16rFFFF * aPercentage / 100) rounded
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4777
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4778
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4779
setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4780
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4781
 'setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue' printCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4782
^ self.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4783
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4784
    "Created: 30.1.1998 / 09:27:48 / md"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4785
    "Modified: 30.1.1998 / 09:30:22 / md"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4786
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4787
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4788
!WinWorkstation methodsFor:'cursor stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4789
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4790
builtInCursorShapes
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4791
    "return a collection of standard cursor names.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4792
     Those are built into Windows and need not be created as
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4793
     user cursors.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4794
     (actually, there are more than those below ...)"
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4795
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4796
    "/ if you add something here, also add to #shapeNumberFromCursor ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4797
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4798
    ^ #(
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4799
	#upLeftArrow            "/ IDC_ARROW
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4800
	#upDownArrow            "/ IDC_SIZENS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4801
	#leftRightArrow         "/ IDC_SIZEWE
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4802
	#text                   "/ IDC_IBEAM
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4803
	#wait                   "/ IDC_WAIT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4804
	#execute                "/ IDC_APPSTARTING
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4805
	#crossHair              "/ IDC_CROSS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4806
	#fourWay                "/ IDC_SIZEALL
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4807
	#upRightHand            "/ IDC_ARROW
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4808
       )
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4809
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4810
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4811
createCursorShape:aShape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4812
    "create a cursor given a shape-symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4813
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4814
    |number|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4815
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4816
    number := self shapeNumberFromSymbol:aShape.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4817
    ^ self primCreateCursorShapeNr:number
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4818
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4819
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4820
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
  4821
    "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
  4822
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4823
    |padding bpl bplPadded srcOffs dstOffs
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4824
     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
  4825
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4826
    cW := self class getSystemMetrics:#cursorWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4827
    cH := self class getSystemMetrics:#cursorHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4828
    "/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4829
    src := sourceBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4830
    mask := maskBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4831
    padding := self cursorBitmapPadding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4832
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4833
    "/ repadding and/or resizing required ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4834
    bpl := sourceBytes size / h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4835
    bplPadded := (cW + padding - 1) // padding * 2.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4836
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4837
    bpl ~~ bplPadded ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4838
	 "/     'repad cursor bits' infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4839
	srcPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4840
	nB := bpl min: bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4841
	nR := cH min: h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4842
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4843
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4844
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4845
	    srcPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4846
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4847
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4848
		with:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4849
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4850
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4851
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4852
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4853
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4854
	maskPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4855
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4856
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4857
	    maskPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4858
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4859
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4860
		with:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4861
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4862
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4863
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4864
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4865
	src := srcPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4866
	mask := maskPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4867
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4868
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4869
    src invert.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4870
    1 to:src size do:[:index |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4871
	src byteAt:index put:((src byteAt:index) bitAnd:(mask byteAt:index)).
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4872
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4873
    mask invert.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4874
    cursor := self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4875
	primCreateCursorSourceBits:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4876
	maskBits:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4877
	hotX:hx hotY:hy
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4878
	width:cW height:cH.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4879
    cursor notNil ifTrue:[  ^ cursor ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4880
    self halt.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4881
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4882
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4883
cursorBitmapPadding
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4884
    ^ 16 "/ windows requires short-padded rows
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4885
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4886
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4887
destroyCursor:aCursorId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4888
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4889
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4890
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4891
    if (ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4892
	if (__isExternalAddress(aCursorId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4893
	    HCURSOR curs = _HCURSORVal(aCursorId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4894
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4895
	    if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4896
#ifdef KEEP_STD_CURSORS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4897
		if ((curs != H_C_ARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4898
		 && (curs != H_C_CROSS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4899
		 && (curs != H_C_IBEAM)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4900
		 && (curs != H_C_ICON)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4901
		 && (curs != H_C_NO)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4902
		 && (curs != H_C_SIZE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4903
		 && (curs != H_C_SIZEALL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4904
		 && (curs != H_C_SIZENESW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4905
		 && (curs != H_C_SIZENS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4906
		 && (curs != H_C_SIZENWSE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4907
		 && (curs != H_C_UPARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4908
		 && (curs != H_C_WAIT)) 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4909
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4910
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4911
		    DestroyCursor(curs);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4912
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4913
	    __cnt_cur--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4914
	    RESPRINTF(("DestroyCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4915
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4916
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4917
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4918
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4919
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4920
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4921
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4922
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4923
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4924
needDeviceFormsForCursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4925
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4926
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4927
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4928
primCreateCursorShapeNr:number
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4929
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4930
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4931
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4932
    LPCTSTR cId;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4933
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4934
    if (__isSmallInteger(number)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4935
	cId = (LPCTSTR)(__intVal(number));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4936
	newCursor = LoadCursor(NULL, cId);
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4937
	if (newCursor) {
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  4938
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4939
	    if (cId == IDC_ARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4940
		H_C_ARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4941
	    else if (cId == IDC_CROSS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4942
		H_C_CROSS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4943
	    else if (cId == IDC_IBEAM)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4944
		H_C_IBEAM = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4945
	    else if (cId == IDC_ICON)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4946
		H_C_ICON = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4947
	    else if (cId == IDC_NO)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4948
		H_C_NO = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4949
	    else if (cId == IDC_SIZE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4950
		H_C_SIZE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4951
	    else if (cId == IDC_SIZEALL)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4952
		H_C_SIZEALL = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4953
	    else if (cId == IDC_SIZENESW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4954
		H_C_SIZENESW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4955
	    else if (cId == IDC_SIZENS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4956
		H_C_SIZENS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4957
	    else if (cId == IDC_SIZENWSE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4958
		H_C_SIZENWSE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4959
	    else if (cId == IDC_UPARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4960
		H_C_UPARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4961
	    else if (cId == IDC_WAIT)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4962
		H_C_WAIT = newCursor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4963
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4964
	    RETURN ( __MKOBJ(newCursor) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4965
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4966
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4967
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4968
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4969
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4970
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4971
primCreateCursorSourceBits:src maskBits:mask hotX:hx hotY:hy width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4972
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4973
%{  /* xxLIMITEDSTACK (WIN95) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4974
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4975
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4976
    if (__isByteArray(src)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4977
     && __isByteArray(mask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4978
     && __bothSmallInteger(hx, hy)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4979
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4980
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4981
	newCursor = CreateCursor((HANDLE) __getHInstance(),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4982
				 __intVal(hx), __intVal(hy),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4983
				 __intVal(w), __intVal(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4984
				 __ByteArrayInstPtr(mask)->ba_element,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4985
				 __ByteArrayInstPtr(src)->ba_element);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4986
	if (newCursor) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4987
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4988
	    __cnt_cur++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4989
	    RESPRINTF(("CreateCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4990
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4991
	    RETURN ( __MKOBJ(newCursor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4992
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4993
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4994
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4995
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4996
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4997
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4998
shapeNumberFromSymbol:shape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4999
    "given a shape-symbol, return the corresponding cursor-number,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5000
     or nil if no such standard cursor exists."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5001
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5002
    "this is pure Win-knowlegde - but you may easily add more"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5003
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5004
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5005
    if (shape == @symbol(upRightHand)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5006
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5007
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5008
    if (shape == @symbol(upLeftArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5009
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5010
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5011
    if (shape == @symbol(upDownArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5012
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENS));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5013
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5014
    if (shape == @symbol(leftRightArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5015
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5016
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5017
    if (shape == @symbol(text)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5018
	RETURN ( __MKSMALLINT( (INT)IDC_IBEAM));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5019
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5020
    if (shape == @symbol(wait)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5021
	RETURN ( __MKSMALLINT( (INT)IDC_WAIT));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5022
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5023
    if (shape == @symbol(crossHair)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5024
	RETURN ( __MKSMALLINT( (INT)IDC_CROSS));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5025
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5026
    if (shape == @symbol(fourWay)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5027
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5028
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5029
    if (shape == @symbol(execute)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5030
	RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5031
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5032
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5033
"/    ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5034
    ^  nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5035
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5036
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5037
!WinWorkstation methodsFor:'drawing'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5038
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5039
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
  5040
		width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5041
    "do a bit-blt; copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5042
     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
  5043
     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
  5044
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5045
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5046
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5047
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5048
    struct gcData *gcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5049
    struct gcData *srcGcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5050
    HDC srcDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5051
    HDC dstDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5052
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5053
    if (__isExternalAddress(srcGCId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5054
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5055
	srcGcData = _GCDATA(srcGCId);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5056
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5057
    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5058
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5059
	goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5060
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5061
    if (__isExternalAddress(dstGCId)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5062
	gcData = _GCDATA(dstGCId);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5063
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5064
    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5065
    {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5066
	goto fail;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5067
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5068
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5069
    if (__bothSmallInteger(w, h)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5070
     && __bothSmallInteger(srcX, srcY)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5071
     && __bothSmallInteger(dstX, dstY))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5072
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5073
	int fun = BITBLT_COPY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5074
	if (srcGcData && gcData)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5075
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5076
	  fun = gcData->bitbltrop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5077
#if 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5078
	  switch (fun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5079
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5080
	    case BITBLT_COPY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5081
	      printf("BITBLT_COPY\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5082
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5083
	    case BITBLT_COPYINVERTED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5084
	      printf("BITBLT_COPYINVERTED\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5085
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5086
	    case BITBLT_XOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5087
	      printf("BITBLT_XOR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5088
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5089
	    case BITBLT_AND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5090
	      printf("BITBLT_AND\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5091
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5092
	    case BITBLT_OR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5093
	      printf("BITBLT_OR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5094
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5095
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5096
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5097
          if (srcGcData->hWnd && ((srcGcData->hWnd == gcData->hWnd) && (fun == BITBLT_COPY)))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5098
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5099
	    RECT rec,uprec;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5100
	    rec.left = __intVal(srcX);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5101
	    rec.top = __intVal(srcY);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5102
	    rec.right = rec.left + __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5103
	    rec.bottom = rec.top + __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5104
	    DPRINTF(("dst and src is HWND %x fun == BITBLT_COPY  --> scrolling %d %d\n",srcGcData->hWnd,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY)));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5105
	    ScrollWindow(srcGcData->hWnd,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY),&rec,0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5106
	    UpdateWindow(srcGcData->hWnd);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5107
	    if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5108
	      enqEvent(ExposureMask,srcGcData->hWnd, __WM_NOGEXPOSE, 0, 0, 0, 0, 0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5109
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5110
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5111
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5112
	  if (srcGcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5113
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5114
	      /*printf("src is HWND %x\n",srcGcData->hWnd);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5115
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5116
	  fun = gcData->bitbltrop2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5117
	  if ((srcGcData == gcData) && (fun == BITBLT_COPY))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5118
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5119
	    RECT rec,uprec;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5120
	    rec.left = __intVal(srcX);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5121
	    rec.top = __intVal(srcY);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5122
	    rec.right = rec.left + __intVal(w);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5123
	    rec.bottom = rec.top + __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5124
	    srcDC = _getDC(srcGcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5125
	    DPRINTF(("dst and src is DC %x fun == BITBLT_COPY  --> scrolling %d %d\n",srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY)));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5126
	    ScrollDC(srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY),&rec,0,0,&uprec);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5127
	    _releaseDC(srcGcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5128
	    RETURN ( self );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5129
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5130
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5131
	  else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5132
          {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5133
            srcDC = _getDC(srcGcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5134
            dstDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5135
            if (BitBlt(dstDC,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5136
		 __intVal(dstX), __intVal(dstY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5137
		 __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5138
		 srcDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5139
		 __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5140
		 fun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5141
	       == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5142
	      )
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5143
              {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5144
                 printf("ERROR in BitBlt\n");
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5145
              }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5146
          }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5147
          _releaseDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5148
          _releaseDC(srcGcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5149
	  RETURN ( self );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5150
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5151
    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  5152
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5153
 fail: ;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5154
%}.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5155
 ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5156
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5157
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5158
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5159
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
  5160
		width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5161
    "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
  5162
     copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5163
     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
  5164
     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
  5165
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5166
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5167
    ^ self
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5168
	copyFromId:sourceId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5169
		 x:srcX y:srcY gc:srcDCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5170
		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
  5171
	     width:w height:h
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5172
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5173
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5174
displayArcX:x y:y width:width height:height from:startAngle angle:angle in:aDrawableId with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5175
    "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
  5176
     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
  5177
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5178
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5179
    int __x, __y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5180
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5181
    double f;
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
    if (__isSmallInteger(startAngle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5184
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5185
    else if (__isFloat(startAngle)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5186
	angle1 = __floatVal(startAngle);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5187
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5188
    if (__isSmallInteger(angle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5189
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5190
    else if (__isFloat(angle)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5191
	angle2 = __floatVal(angle);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5192
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5193
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5194
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5195
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5196
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5197
     {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5198
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5199
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5200
	POINT p;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5201
        HPEN hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5202
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5203
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5204
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5205
	__x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5206
	__y = __intVal(y);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5207
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5208
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5209
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5210
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5211
	    DPRINTF(("displayArc: no pen\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5212
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5213
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5214
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5215
	    double xB, yB, xE, yE, xR, yR;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5216
            HPEN hSavePen = SelectObject(hDC, hPen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5217
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5218
	    yR = h / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5219
	    if (angle2 - angle1 >= 360)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5220
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5221
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5222
		yB = yE = __y /*+ yR + 0.5*/;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5223
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5224
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5225
	    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5226
		double sin(), cos();
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5227
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5228
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5229
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5230
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5231
		angle2 = angle1 - angle2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5232
		/* sigh - compute the intersections ... */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5233
		xB = (cos((angle1 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5234
		yB = (sin((angle1 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5235
		xE = (cos((angle2 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5236
		yE = (sin((angle2 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5237
		xB = __x + xR - xB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5238
		yB = __y + yR - yB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5239
		xE = __x + xR - xE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5240
		yE = __y + yR - yE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5241
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5242
	    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
  5243
	    Arc(hDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5244
		__x, __y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5245
		__x + w, __y + h,
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5246
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5247
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5248
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5249
            SelectObject(hDC,hSavePen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5250
            DelObject(hPen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5251
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5252
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5253
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5254
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5255
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5256
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5257
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5258
displayLineFromX:x0 y:y0 toX:x1 y:y1 in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5259
    "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
  5260
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5261
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5262
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5263
     /*&& __isExternalAddress(aDrawableId)*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5264
     && __bothSmallInteger(x0, y0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5265
     && __bothSmallInteger(x1, y1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5266
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5267
	int __x1 = __intVal(x1), __y1 = __intVal(y1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5268
        HPEN hPen;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5269
	HDC hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5270
/*      DPRINTF(("displayLine: %d/%d -> %d/%d in %x\n",
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5271
		    __intVal(x0), __intVal(y0),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5272
		    __x1, __y1,_HWNDVal(aDrawableId)));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5273
*/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5274
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5275
	    DPRINTF(("displayLine: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5276
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5277
            HPEN hSavePen = SelectObject(hDC, hPen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5278
	    MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5279
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5280
	    LineTo(hDC, __x1, __y1);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5281
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5282
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5283
	     */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5284
	    LineTo(hDC, __x1+1, __y1);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5285
            SelectObject(hDC,hSavePen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5286
            DelObject(hPen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5287
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5288
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5289
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5290
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5291
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5292
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5293
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5294
displayPointX:px y:py in:aDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5295
    "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
  5296
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5297
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5298
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5299
     && __isExternalAddress(aDrawableId)
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5300
     && __bothSmallInteger(px, py)) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5301
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5302
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5303
	POINT p;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5304
        HPEN hPen;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5305
	int __x = __intVal(px), __y = __intVal(py);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5306
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5307
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5308
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5309
	    DPRINTF(("displayPoint: no pen\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5310
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5311
            HPEN hSavePen = SelectObject(hDC, hPen);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5312
	    MoveToEx(hDC, __x, __y, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5313
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5314
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5315
	     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5316
	    LineTo(hDC, __x+1, __y);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5317
            SelectObject(hDC,hSavePen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5318
            DelObject(hPen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5319
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5320
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5321
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5322
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5323
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5324
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5325
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5326
displayPolygon:aPolygon in:aDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5327
    "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
  5328
     which define the polygon.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5329
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5330
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5331
    |numberOfPoints |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5332
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5333
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5334
    self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5335
	primDisplayPolygon:aPolygon n:numberOfPoints
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5336
	in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5337
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5338
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5339
displayRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5340
    "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
  5341
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5342
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5343
    int w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5344
    int xL, yT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5345
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5346
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5347
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5348
     && __bothSmallInteger(width, height)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5349
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5350
	HDC hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5351
        HPEN hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5352
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5353
	xL = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5354
	yT = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5355
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5356
	h = __intVal(height);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5357
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5358
	DPRINTF(("displayRectangle: %d/%d -> %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5359
			xL, yT, w, h));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5360
	/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5361
	 * need this check here: some servers simply dump core with bad args
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5362
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5363
	if ((w >= 0) && (h >= 0)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5364
	    if (!(hPen = GcDataGetPen(hDC,gcData))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5365
		DPRINTF(("displayRect: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5366
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5367
                HPEN hSavePen = SelectObject(hDC, hPen);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5368
		MoveToEx(hDC, xL, yT, NULL);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5369
		LineTo(hDC, xL+w-1, yT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5370
		LineTo(hDC, xL+w-1, yT+h-1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5371
		LineTo(hDC, xL, yT+h-1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5372
		LineTo(hDC, xL, yT);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5373
                SelectObject(hDC,hSavePen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5374
                DelObject(hPen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5375
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5376
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5377
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5378
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5379
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5380
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5381
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5382
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5383
displayString:aString from:index1 to:index2 x:x y:y in:aDrawableId with:aGCId opaque:opaque
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5384
    "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
  5385
     foreground and background characters.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5386
     If the coordinates are not integers, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5387
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5388
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5389
    unsigned char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5390
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5391
    int  i1, i2, l, n;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5392
#   define NLOCALBUFFER 200
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5393
    short xlatebuffer[NLOCALBUFFER];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5394
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5395
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5396
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5397
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5398
     && __isNonNilObject(aString)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5399
     && __bothSmallInteger(index1, index2)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5400
     && __bothSmallInteger(x, y)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5401
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5402
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5403
	int pX, pY;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5404
	HDC hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5405
	HFONT hOldFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5406
	pX = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5407
	pY = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5408
	pY -= gcData->fontAscent;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5409
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5410
	cls = __qClass(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5411
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5412
	i1 = __intVal(index1) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5413
	if (i1 >= 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5414
	    i2 = __intVal(index2) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5415
	    if (i2 < i1) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5416
		goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5417
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5418
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5419
	    cp = _stringVal(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5420
	    l = i2 - i1 + 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5421
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5422
	    if ((cls == @global(String)) || (cls == @global(Symbol))) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5423
	    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5424
		n = _stringSize(aString);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5425
		if (i2 < n) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5426
		{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5427
		    cp += i1;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5428
		    DPRINTF(("string1: %s pos=%d/%d l=%d hDC=%x hWnd=%x\n", cp, pX, pY,l,hDC,_HWNDVal(aDrawableId)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5429
		    if (opaque == true) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5430
			SetBkMode(hDC, OPAQUE);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5431
		    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5432
			SetBkMode(hDC, TRANSPARENT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5433
		    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5434
		    hOldFont = SelectObject(hDC, gcData->hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5435
		    SetTextColor(hDC, gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5436
		    SetBkColor(hDC, gcData->bgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5437
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5438
		    if (!TextOut(hDC, pX, pY, (char *)cp, l))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5439
		    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5440
		       PRINTF(("Textout failed. %d\n",GetLastError()));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5441
		    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5442
		    SelectObject(hDC, hOldFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5443
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5444
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5445
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5446
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5447
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5448
	    cp += nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5449
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5450
	    if (__isBytes(aString)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5451
	    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5452
		n = __byteArraySize(aString) - nInstBytes - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5453
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5454
		if (i2 < n) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5455
		{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5456
		    cp += i1;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5457
		    DPRINTF(("string: %s pos=%d/%d\n", cp, pX, pY));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5458
		    if (opaque == true) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5459
			SetBkMode(hDC, OPAQUE);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5460
		    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5461
			SetBkMode(hDC, TRANSPARENT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5462
		    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5463
		    hOldFont = SelectObject(hDC, gcData->hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5464
		    SetTextColor(hDC, gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5465
		    SetBkColor(hDC, gcData->bgColor);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5466
		    TextOut(hDC, pX, pY, (char *)cp, l);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5467
		    SelectObject(hDC, hOldFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5468
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5469
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5470
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5471
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5472
#ifdef NOTDEF 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5473
	    /* TWOBYTESTRINGS */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5474
	    if (__isWords(aString)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5475
		n = (__byteArraySize(aString) - nInstBytes) / 2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5476
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5477
		if (i2 < n) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5478
		    union {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5479
			char b[2];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5480
			unsigned short s;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5481
		    } u;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5482
		    int i;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5483
		    XChar2b *cp2 = (XChar2b *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5484
		    int mustFree = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5485
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5486
		    cp += (i1 * 2);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5487
		    if (l > 1000) l = 1000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5488
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5489
		    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5490
		     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5491
		     * X expects them MSB first
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5492
		     * convert as required
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5493
		     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5494
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5495
		    u.s = 0x1234;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5496
		    if (u.b[0] != 0x12) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5497
			if (l <= NLOCALBUFFER) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5498
			    cp2 = xlatebuffer;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5499
			} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5500
			    cp2 = (XChar2b *)(malloc(l * 2));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5501
			    mustFree = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5502
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5503
			for (i=0; i<l; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5504
			    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5505
			    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5506
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5507
			cp = (char *) cp2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5508
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5509
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5510
		    if (opaque == true)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5511
			XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5512
		    else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5513
			XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5514
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5515
		    if (mustFree) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5516
			free(cp2);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5517
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5518
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5519
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5520
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5521
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5522
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5523
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5524
ret:   
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5525
	_releaseDC(gcData); 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5526
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5527
#undef NLOCALBUFFER
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5528
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5529
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5530
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5531
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5532
			  width:imageWidth height:imageHeight
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5533
			      x:srcx y:srcy
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5534
			   into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5535
			      x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5536
			  width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5537
			   with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5538
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5539
    "draw a bitImage which has depth id, width iw and height ih into
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5540
     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
  5541
     Individual source pixels have bitsPerPixel bits, allowing to draw
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5542
     depth and pixel-units to be different.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5543
     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
  5544
     depth - otherwise, primitive failure will be signalled.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5545
     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
  5546
     colors are allocated - otherwise the colors may be wrong."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5547
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5548
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5549
     sorry; I had to separate it into 2 methods, since XPutImage needs
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5550
     an unlimited stack, and thus cannot send primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5551
    "
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5552
    (self primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5553
					width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5554
					     x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5555
					  into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5556
					     x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5557
					 width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5558
					  with:aGCId)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5559
    ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5560
	"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5561
	 also happens, if a segmentation violation occurs in the
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5562
	 XPutImage ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5563
	"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5564
	self primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5565
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5566
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5567
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5568
fillArcX:x y:y width:width height:height from:startAngle angle:angle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5569
	       in:aDrawableId with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5570
    "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
  5571
     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
  5572
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5573
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5574
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5575
    int __x, __y, w, h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5576
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5577
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5578
    if (__isSmallInteger(startAngle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5579
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5580
    else if (__isFloat(startAngle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5581
	angle1 = __floatVal(startAngle);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5582
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5583
    if (__isSmallInteger(angle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5584
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5585
    else if (__isFloat(angle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5586
	angle2 = __floatVal(angle);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5587
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5588
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5589
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5590
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5591
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5592
     {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5593
	struct gcData *gcData = _GCDATA(aGCId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5594
	HDC hDC;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5595
	HBRUSH hBrush;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5596
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5597
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5598
	h = __intVal(height);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5599
	__x = __intVal(x);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5600
	__y = __intVal(y);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5601
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5602
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5603
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5604
	if (!(hBrush = GcDataGetBrush(hDC,gcData))) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5605
	    DPRINTF(("fillArc: no brush\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5606
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5607
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5608
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5609
          HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5610
          HPEN hPen = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5611
          HPEN hSavePen;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5612
	  if (__isWinNT)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5613
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5614
	    if (!(hPen = GcDataGetPen(hDC,gcData)))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5615
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5616
	      DPRINTF(("displayArc: no pen\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5617
	      goto failpen;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5618
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5619
            hSavePen = SelectObject(hDC, hPen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5620
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5621
	  else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5622
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5623
	    SelectObject(hDC,GetStockObject(NULL_PEN));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5624
	    w++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5625
	    h++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5626
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5627
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5628
	    double xB, yB, xE, yE, xR, yR;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5629
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5630
	    yR = h / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5631
	    if (angle2 - angle1 >= 360)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5632
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5633
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5634
		yB = yE = __y /*+ yR + 0.5*/;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5635
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5636
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5637
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5638
		double sin(), cos();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5639
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5640
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5641
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5642
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5643
		angle2 = angle1 - angle2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5644
		/* sigh - compute the intersections ... */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5645
		xB = (cos((angle1 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5646
		yB = (sin((angle1 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5647
		xE = (cos((angle2 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5648
		yE = (sin((angle2 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5649
		xB = __x + xR - xB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5650
		yB = __y + yR - yB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5651
		xE = __x + xR - xE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5652
		yE = __y + yR - yE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5653
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5654
	    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));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5655
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5656
	    Pie(hDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5657
		__x, __y,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5658
		__x + w, __y + h,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5659
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5660
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5661
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5662
	    if (hPen) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5663
              SelectObject(hDC,hSavePen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5664
              DelObject(hPen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5665
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5666
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5667
failpen:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5668
          SelectObject(hDC,hSaveBrush);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5669
          DelObject(hBrush);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5670
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5671
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5672
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5673
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5674
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5675
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5676
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5677
fillPolygon:aPolygon in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5678
    "fill a polygon given by its points.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5679
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5680
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5681
    |numberOfPoints|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5682
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5683
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5684
    self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5685
	primFillPolygon:aPolygon n:numberOfPoints 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5686
	in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5687
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5688
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5689
fillRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5690
    "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
  5691
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5692
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5693
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5694
    int w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5695
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5696
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5697
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5698
     && __bothSmallInteger(width, height)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5699
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5700
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5701
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5702
	/*DPRINTF(("fillRect %d/%d -> %d/%d\n", __intVal(x), __intVal(y), w, h));*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5703
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5704
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5705
	 * need this check here: some servers simply dump core with bad args
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5706
	 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5707
	if ((w >= 0) && (h >= 0))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5708
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5709
	    struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5710
	    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5711
	    HBRUSH hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5712
	    RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5713
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5714
	    hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5715
	    hBrush = GcDataGetBrush(hDC,gcData);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5716
	    if (! hBrush)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5717
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5718
		PRINTF(("fillRectangle: no brush\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5719
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5720
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5721
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5722
              HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5723
	      rct.left = __intVal(x);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5724
	      rct.top = __intVal(y);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5725
	      rct.right = rct.left + w + 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5726
	      rct.bottom = rct.top + h + 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5727
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5728
	      DPRINTF(("fillRectangle:%d.%d -> %d.%d\n",rct.left,rct.top,rct.right,rct.bottom));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5729
	      SelectObject(hDC, GetStockObject(NULL_PEN));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5730
	      Rectangle(hDC,rct.left,rct.top,rct.right,rct.bottom);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5731
              SelectObject(hDC,hSaveBrush);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5732
              DelObject(hBrush);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5733
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5734
	    _releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5735
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5736
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5737
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5738
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5739
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5740
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5741
primDisplayPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5742
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5743
%{  /* xxLIMITEDSTACK (WIN95 only) */
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5744
    OBJ point, px, py;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5745
    int i, num;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5746
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5747
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5748
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5749
     && __isSmallInteger(numberOfPoints)) {
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5750
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5751
	HDC hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5752
	POINT p;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5753
        HPEN hPen;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5754
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5755
	num = __intVal(numberOfPoints);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5756
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5757
	for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5758
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5759
	    if (! __isPoint(point)) goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5760
	    px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5761
	    py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5762
	    if (! __bothSmallInteger(px, py))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5763
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5764
		_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5765
		goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5766
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5767
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5768
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5769
	    DPRINTF(("displayPolygon: no pen\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5770
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5771
            HPEN hSavePen = SelectObject(hDC, hPen);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5772
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5773
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5774
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5775
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5776
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5777
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5778
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5779
		    p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5780
		    p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5781
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5782
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5783
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5784
			LineTo(hDC, p.x, p.y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5785
			/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5786
			 * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5787
			 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5788
			LineTo(hDC, p.x+1, p.y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5789
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5790
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5791
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5792
            SelectObject(hDC,hSavePen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5793
            DelObject(hPen);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5794
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5795
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5796
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5797
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5798
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5799
fail: ;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5800
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5801
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5802
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5803
primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5804
			      width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5805
				  x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5806
			       into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5807
				  x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5808
			      width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5809
			       with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5810
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5811
    "since XPutImage may allocate huge amount of stack space
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5812
     (some implementations use alloca), this must run with unlimited stack."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5813
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5814
%{  /* xxLIMITEDSTACK */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5815
    unsigned char fastBits[10000];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5816
    unsigned char *b_bits = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5817
    unsigned char *allocatedBits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5818
    struct gcData *gcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5819
    HDC hDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5820
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5821
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5822
     && __isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5823
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5824
     && __bothSmallInteger(srcx, srcy)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5825
     && __bothSmallInteger(dstx, dsty)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5826
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5827
     && __bothSmallInteger(imageWidth, imageHeight)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5828
     && __bothSmallInteger(imageDepth, bitsPerPixel)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5829
     && __isSmallInteger(padd)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5830
     && __isByteArray(imageBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5831
     {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5832
	struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5833
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5834
	  BITMAPINFOHEADER bmiHeader;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5835
	  DWORD r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5836
	  DWORD g;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5837
	  DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5838
	} bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5839
	gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5840
	if (! gcData )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5841
	    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5842
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5843
	DDPRINTF(("hDC = %x\n", hDC));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5844
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5845
	if (__intVal(padd) != WIN32PADDING)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5846
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5847
	  int row, col;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5848
	  unsigned char *cp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5849
	  unsigned char *pBits;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5850
	  int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding, nBytes;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5851
	  int bi = __intVal(bitsPerPixel);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5852
	  b_width = __intVal(w);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5853
	  b_height = __intVal(h);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5854
	  bytesPerRowST = (b_width * bi + (__intVal(padd)-1)) / __intVal(padd);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5855
	  bytesPerRowWN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5856
	  padding = bytesPerRowWN - bytesPerRowST;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5857
	  nBytes = b_height * bytesPerRowWN;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5858
	  /*printf("padd %d bs %d bw %d p %d\n",__intVal(padd),bytesPerRowST,bytesPerRowWN,padding);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5859
	  if (padding)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5860
	  {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5861
	    if (nBytes < sizeof(fastBits))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5862
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5863
		cp = b_bits = fastBits;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5864
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5865
	    else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5866
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5867
		cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
2236
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
  5868
                CPRINTF(("malloc for drawBits\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5869
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5870
	    if (cp)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5871
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5872
		pBits = __ByteArrayInstPtr(imageBits)->ba_element;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5873
		for (row = b_height; row; row--)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5874
		{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5875
		    for (col = bytesPerRowST; col; col--)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5876
		    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5877
			*cp++ = ( *pBits++ );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5878
		    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5879
		    cp += padding;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5880
		}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5881
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5882
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5883
	      goto fail;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5884
	  }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5885
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5886
	if (b_bits == 0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5887
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5888
	   b_bits = __ByteArrayInstPtr(imageBits)->ba_element;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5889
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5890
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5891
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5892
	bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5893
	bitmap.bmiHeader.biPlanes = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5894
	if (__intVal(imageDepth) == 24)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5895
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5896
	  /*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5897
	  bitmap.r = 0xff0000;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5898
	  bitmap.g = 0x00ff00;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5899
	  bitmap.b = 0x0000ff;*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5900
	  bitmap.bmiHeader.biCompression = BI_RGB;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5901
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5902
	else if (__intVal(imageDepth) == 16)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5903
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5904
	  /*bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5905
	  bitmap.bmiHeader.biCompression = BI_BITFIELDS;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5906
	  bitmap.b = 0x001f;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5907
	  bitmap.g = 0x07e0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5908
	  bitmap.r = 0xf800;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5909
	  bitmap.b = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5910
	  bitmap.g = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5911
	  bitmap.r = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5912
	  bitmap.bmiHeader.biCompression = BI_RGB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5913
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5914
	bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5915
	bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5916
	bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5917
	bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5918
	bitmap.bmiHeader.biClrImportant = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5919
	bitmap.bmiHeader.biWidth = __intVal(imageWidth);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5920
	bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5921
	bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5922
	/*printf("drawBits depth:%d bitsPerPixel:%d IW%d W:%d H:%d\n",__intVal(imageDepth),bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biWidth,__intVal(w),bitmap.bmiHeader.biHeight);*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5923
	SetDIBitsToDevice(hDC,__intVal(dstx),__intVal(dsty),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5924
			      __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5925
			      __intVal(srcx), __intVal(srcy),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5926
			      0,__intVal(h),
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5927
			      (void *)b_bits,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5928
			      (BITMAPINFO*)&bitmap,DIB_RGB_COLORS);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5929
	if (allocatedBits)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5930
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5931
	  free(allocatedBits);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5932
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5933
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5934
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5935
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5936
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5937
fail: ;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5938
    PRINTF(("create temp bitmap FAILED!!!\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5939
    if (allocatedBits)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5940
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5941
      PRINTF(("freeing up temp bitmap bits ...\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5942
      free(allocatedBits);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5943
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5944
    if (gcData && hDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5945
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5946
%}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5947
.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5948
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5949
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5950
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5951
primFillPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5952
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5953
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5954
    OBJ point, px, py;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5955
    int i, num;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5956
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5957
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5958
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5959
     && __isSmallInteger(numberOfPoints)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5960
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5961
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5962
	POINT p;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5963
        HBRUSH hBrush;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5964
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5965
	num = __intVal(numberOfPoints);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5966
	if (num < 3) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5967
	    RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5968
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5969
	for (i=0; i<num; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5970
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5971
	    if (! __isPoint(point)) goto fail;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5972
	    px = _point_X(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5973
	    py = _point_Y(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5974
	    if (! __bothSmallInteger(px, py))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5975
		goto fail;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5976
	}
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5977
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5978
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5979
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5980
	if (!(hBrush = GcDataGetBrush(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5981
	    DPRINTF(("fillPolygon: no brush\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5982
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5983
            HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5984
	    BeginPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5985
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5986
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5987
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5988
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5989
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5990
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5991
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5992
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5993
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5994
			p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5995
			p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5996
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5997
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5998
			LineTo(hDC, __intVal(px), __intVal(py));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5999
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6000
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6001
	    }
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6002
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6003
	    EndPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6004
	    FillPath(hDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6005
            SelectObject(hDC,hSaveBrush);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6006
            DelObject(hBrush);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6007
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6008
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6009
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6010
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6011
fail: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6012
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6013
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6014
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6015
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6016
!WinWorkstation methodsFor:'event handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6017
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6018
configEventProcessedFor:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6019
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6020
    if (__isExternalAddress(aWindowId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6021
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6022
      HWND hWnd = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6023
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6024
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6025
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6026
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6027
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6028
dispatchEventFor:aViewIdOrNil withMask:eventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6029
    "central event handling method:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6030
     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
  6031
     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
  6032
     otherwise only events for the view with given id are processed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6033
     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
  6034
     handled.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6035
     WARNING: this may block to wait for an event - you better check for a 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6036
	      pending event before calling this."
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6037
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6038
    (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6039
	AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6040
	    ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6041
	] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6042
	    self dispatchLastEvent.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6043
	]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6044
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6045
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6046
    "Modified: 19.8.1997 / 17:10:42 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6047
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6048
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6049
dispatchExposeEventFor:aViewIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6050
    "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
  6051
     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
  6052
     otherwise only events for the view with given id are processed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6053
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6054
    self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6055
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6056
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6057
dispatchLastEvent
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6058
    |theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6059
     eventType|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6060
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6061
%{  /* xxSTACK: 8000 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6062
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6063
    struct queuedEvent _ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6064
    struct inlineCache *ipS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6065
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6066
    static struct inlineCache vid = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6067
    static struct inlineCache conf = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6068
    static struct inlineCache skp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6069
    static struct inlineCache skr = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6070
    static struct inlineCache exp = _ILC5;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6071
    static struct inlineCache gexpS = _ILC6;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6072
    static struct inlineCache nexpS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6073
    static struct inlineCache clr = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6074
    static struct inlineCache bp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6075
    static struct inlineCache br = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6076
    static struct inlineCache bmp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6077
    static struct inlineCache bsp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6078
    static struct inlineCache mot = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6079
    static struct inlineCache unmap = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6080
    static struct inlineCache map = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6081
    static struct inlineCache termS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6082
    static struct inlineCache destr = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6083
    static struct inlineCache setCurs = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6084
    static struct inlineCache focOut = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6085
    static struct inlineCache focIn = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6086
    static struct inlineCache act = _ILC2;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6087
    static struct inlineCache pe = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6088
    static struct inlineCache pl = _ILC2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6089
    static struct inlineCache vis = _ILC1;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6090
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6091
    int x, y, w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6092
    int keyCode, modifiers, isDoubleClick = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6093
    int isDown = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6094
    int state;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6095
    OBJ upDown;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6096
    OBJ eB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6097
    char nameBuffer[100];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6098
    HWND hWnd = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6099
    DDPRINTF(("dispatchLast\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6100
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6101
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6102
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6103
    if (__isByteArray(eB)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6104
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6105
    } else {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6106
	printf("DISPLAY: no eventBuffer\n");
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6107
	RETURN (false);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6108
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6109
    if (ev)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6110
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6111
      _ev_buf = *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6112
      ev = &_ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6113
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6114
    hWnd = ev->ev_hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6115
    if (!(hWnd /*&& IsWindow(hWnd)*/)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6116
	DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6117
	RETURN (false);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6118
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6119
    {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6120
	OBJ t;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6121
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6122
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6123
	 * very often, its another event for the same view ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6124
	 * avoid creation & lookup then.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6125
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6126
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6127
	if ((t = __INST(lastId)) != nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6128
	    if (__isExternalAddress(t)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6129
		if (_HWNDVal(t) == hWnd) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6130
		    theView = __INST(lastView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6131
		    if (__isNonNilObject(theView)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6132
			if (__qClass(theView) == nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6133
			    theView = nil;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6134
			}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6135
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6136
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6137
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6138
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6139
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6140
	if (theView == nil) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6141
	    windowID = __MKOBJ(ev->ev_hWnd);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6142
	    theView = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, windowID);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6143
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6144
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6145
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6146
    if (theView == nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6147
	DPRINTF(("nil view [hWnd=%x] in dispatchEvent\n", ev->ev_hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6148
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6149
	RETURN (false);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6150
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6151
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6152
    switch (ev->ev_message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6153
#if 1
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6154
	    case WM_WINDOWPOSCHANGED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6155
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6156
		RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6157
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6158
		DPRINTF((">>> WM_WINDOWPOSCHANGED -> configureX:y:width:height:view:\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6159
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6160
		x = ev->ev_x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6161
		y = ev->ev_y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6162
		w = ev->ev_w;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6163
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6164
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6165
		/*printf(">>> WM_WINDOWPOSCHANGED -> configureX:%d y:%d width:%d height: %d\n",x,y,w,h);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6166
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6167
		(*conf.ilc_func)(self,
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6168
			     @symbol(configureX:y:width:height:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6169
			     nil, &conf,
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6170
			     __MKSMALLINT(x),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6171
			     __MKSMALLINT(y),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6172
			     __MKSMALLINT(w),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6173
			     __MKSMALLINT(h),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6174
			     theView);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6175
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6176
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6177
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6178
	    case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6179
		if (ev->ev_wParam == TRUE) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6180
		    DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6181
		    arg = @symbol(unobscured);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6182
		    (*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6183
		    (*map.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6184
				     @symbol(mappedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6185
				     nil, &map, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6186
		} else {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6187
		    DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6188
		    arg = @symbol(fullyObscured);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6189
		    (*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6190
		    (*unmap.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6191
				       @symbol(unmappedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6192
				       nil, &unmap, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6193
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6194
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6195
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6196
	    case WM_CLOSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6197
		    (*termS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6198
				      @symbol(terminateView:), nil, &termS, theView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6199
		    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6200
	    case WM_DESTROY:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6201
		DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6202
		(*destr.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6203
				   @symbol(destroyedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6204
				   nil, &destr, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6205
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6206
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6207
	    case WM_ACTIVATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6208
		DPRINTF((">>> WM_ACTIVATE h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6209
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6210
		switch (LOWORD(ev->ev_wParam)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6211
		    case WA_INACTIVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6212
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6213
					@symbol(activate:view:),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6214
					nil,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6215
					&act,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6216
					false,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6217
					theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6218
			break;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6219
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6220
		    case WA_ACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6221
		    case WA_CLICKACTIVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6222
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6223
					@symbol(activate:view:),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6224
					nil,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6225
					&act,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6226
					true,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6227
					theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6228
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6229
		    default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6230
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6231
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6232
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6233
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6234
	    case WM_MOUSEACTIVATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6235
		DPRINTF((">>> WM_MOUSEACTIVATE h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6236
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6237
		(*focIn.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6238
				   @symbol(focusInView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6239
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6240
				   &focIn,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6241
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6242
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6243
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6244
	    case WM_SETFOCUS:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6245
		DPRINTF((">>> WM_SETFOCUS h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6246
		(*focIn.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6247
				   @symbol(focusInView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6248
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6249
				   &focIn,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6250
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6251
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6252
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6253
	    case WM_KILLFOCUS:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6254
		DPRINTF((">>> WM_KILLFOCUS h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6255
		(*focOut.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6256
				   @symbol(focusOutView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6257
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6258
				   &focOut,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6259
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6260
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6261
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6262
	    case __WM_GEXPOSE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6263
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6264
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6265
		w = ev->ev_w;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6266
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6267
		(*gexpS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6268
			 @symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6269
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6270
			 __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6271
			 __MKSMALLINT(w),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6272
			 __MKSMALLINT(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6273
			 true,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6274
			 theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6275
		break;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6276
	    case __WM_NOGEXPOSE:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6277
		 (*nexpS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6278
			 @symbol(noExposeView:), nil, &nexpS,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6279
			 theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6280
		break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6281
	    case WM_PAINT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6282
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6283
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6284
		w = ev->ev_w;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6285
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6286
		/*printf("paint %x: %d %d %d %d\n",ev->ev_hWnd,x,y,w,h);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6287
	    /*expose:*/
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6288
		DPRINTF((">>> WM_PAINT -> expose %d/%d -> %d/%d\n", x, y, w, h));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6289
		(*exp.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6290
			 @symbol(exposeX:y:width:height:view:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6291
			 nil, &exp,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6292
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6293
			 __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6294
			 __MKSMALLINT(w),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6295
			 __MKSMALLINT(h),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6296
			 theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6297
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6298
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6299
	    case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6300
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6301
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6302
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6303
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6304
	    case WM_LBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6305
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6306
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6307
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6308
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6309
	    case WM_LBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6310
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6311
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6312
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6313
	    case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6314
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6315
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6316
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6317
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6318
	    case WM_MBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6319
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6320
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6321
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6322
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6323
	    case WM_MBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6324
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6325
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6326
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6327
	    case WM_RBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6328
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6329
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6330
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6331
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6332
	    case WM_RBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6333
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6334
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6335
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6336
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6337
	    case WM_RBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6338
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6339
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6340
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6341
	    commonButtonDown:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6342
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6343
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6344
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6345
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6346
		if (__INST(buttonTranslation) != nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6347
		    butt = __AT_(__INST(buttonTranslation), butt);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6348
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6349
		arg = butt;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6350
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6351
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6352
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6353
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6354
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6355
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6356
		if (isDoubleClick)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6357
		{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6358
		    multiClickState = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6359
		    nextMultiClickTime = lastMSGTime + multiClickTime;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6360
		    ipS = &bmp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6361
		    symS = @symbol(buttonMultiPress:x:y:view:);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6362
		}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6363
		else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6364
		{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6365
		    if (isDown)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6366
		    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6367
			if (multiClickState && (lastMSGTime < nextMultiClickTime))
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6368
			{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6369
			  nextMultiClickTime = lastMSGTime + multiClickTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6370
			  ipS = &bmp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6371
			  symS = @symbol(buttonMultiPress:x:y:view:);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6372
			}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6373
			else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6374
			{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6375
			  multiClickState = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6376
			  ipS = &bp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6377
			  symS = @symbol(buttonPress:x:y:view:);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6378
			}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6379
		    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6380
		    else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6381
		    {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6382
			ipS = &br;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6383
			symS = @symbol(buttonRelease:x:y:view:);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6384
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6385
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6386
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6387
		if (__isSymbol(arg)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6388
		    DPRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6389
				__stringVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6390
		} else {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6391
		    DPRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6392
				__intVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6393
		}
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
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6396
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6397
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6398
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6399
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6400
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6401
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6402
	    case __WM_MOUSEENTER:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6403
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6404
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6405
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6406
		DPRINTF((">>> WM_MOUSEENTER: %d/%d %x\n", x, y, state));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6407
		(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6408
				    nil, &pe,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6409
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6410
				    __MKSMALLINT(x),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6411
				    __MKSMALLINT(y),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6412
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6413
		break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6414
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6415
	    case __WM_MOUSELEAVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6416
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6417
		DPRINTF((">>> WM_MOUSELEAVE: %d/%d %x\n", x, y, state));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6418
		(*pl.ilc_func)(self, @symbol(pointerLeave:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6419
				    nil, &pl,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6420
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6421
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6422
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6423
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6424
	    case WM_MOUSEMOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6425
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6426
		x = ev->ev_x;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6427
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6428
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6429
		DPRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6430
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6431
		(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6432
				    nil, &mot,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6433
				    __MKSMALLINT(state),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6434
				    __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6435
				    __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6436
				    theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6437
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6438
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6439
	    case WM_CHAR:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6440
		DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6441
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6442
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6443
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6444
		goto keyPressAndRelease;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6445
	    case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6446
	    case WM_KEYUP:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6447
		DPRINTF((">>> WM_KEYUP / SYSKEYUP: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6448
		symS = @symbol(keyRelease:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6449
		ipS = &skr;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6450
		upDown = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6451
		goto keyPressAndRelease;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6452
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6453
	    case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6454
	    case WM_KEYDOWN:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6455
#ifdef DEBUG
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6456
		if (ev->ev_keyCode == 0x11)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6457
		  c_count = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6458
#endif
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6459
		DPRINTF((">>> WM_KEYDOWN / SYSKEYDOWN: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6460
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6461
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6462
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6463
		/* FALL INTO */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6464
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6465
	    keyPressAndRelease: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6466
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6467
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6468
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6469
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6470
#ifdef NOTDEF
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6471
		{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6472
		    BYTE vKeyState[256];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6473
		    char buff[5];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6474
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6475
		    GetKeyboardState(vKeyState);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6476
		    ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6477
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6478
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6479
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6480
		keyCode = ev->ev_keyCode;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6481
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6482
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6483
		if (modifiers & TRANSLATED_KEY) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6484
		    if (modifiers & ControlMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6485
			if (keyCode < 0x20) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6486
			    keyCode = keyCode + 'a' - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6487
			    if (modifiers & ShiftMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6488
				keyCode = keyCode - 'a' + 'A';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6489
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6490
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6491
		    } else if (modifiers & (MetaMask | AltMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6492
			if (! (modifiers & ShiftMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6493
			    if ((keyCode >= 'A') && (keyCode <= 'Z')) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6494
				keyCode = keyCode - 'A' + 'a';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6495
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6496
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6497
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6498
		    arg = __MKCHARACTER(keyCode & 0xFF);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6499
		} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6500
		    switch (keyCode) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6501
			case VK_F1:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6502
			    arg = @symbol(F1);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6503
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6504
			case VK_F2:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6505
			    arg = @symbol(F2);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6506
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6507
			case VK_F3:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6508
			    arg = @symbol(F3);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6509
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6510
			case VK_F4:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6511
			    arg = @symbol(F4);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6512
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6513
			case VK_F5:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6514
			    arg = @symbol(F5);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6515
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6516
			case VK_F6:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6517
			    arg = @symbol(F6);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6518
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6519
			case VK_F7:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6520
			    arg = @symbol(F7);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6521
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6522
			case VK_F8:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6523
			    arg = @symbol(F8);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6524
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6525
			case VK_F9:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6526
			    arg = @symbol(F9);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6527
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6528
			case VK_F10:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6529
			    arg = @symbol(F10);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6530
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6531
			case VK_F11:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6532
			    arg = @symbol(F11);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6533
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6534
			case VK_F12:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6535
			    arg = @symbol(F12);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6536
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6537
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6538
			case VK_PRIOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6539
			    arg = @symbol(Prior);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6540
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6541
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6542
			case VK_NEXT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6543
			    arg = @symbol(Next);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6544
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6545
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6546
			case VK_END:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6547
			    arg = @symbol(End);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6548
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6549
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6550
			case VK_HOME:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6551
			    arg = @symbol(Home);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6552
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6553
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6554
			case VK_LEFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6555
			    arg = @symbol(CursorLeft);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6556
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6557
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6558
			case VK_RIGHT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6559
			    arg = @symbol(CursorRight);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6560
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6561
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6562
			case VK_UP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6563
			    arg = @symbol(CursorUp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6564
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6565
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6566
			case VK_DOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6567
			    arg = @symbol(CursorDown);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6568
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6569
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6570
			case VK_MENU:  /*alt taste bei w95 ???*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6571
			    arg = @symbol(Menu);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6572
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6573
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6574
			case VK_LMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6575
			    arg = @symbol(Menu_L);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6576
			    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6577
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6578
			case VK_RMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6579
			    arg = @symbol(Menu_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6580
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6581
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6582
			case VK_PAUSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6583
			    arg = @symbol(Pause);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6584
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6585
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6586
			case VK_HELP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6587
			    arg = @symbol(Help);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6588
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6589
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6590
			case VK_EXECUTE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6591
			    arg = @symbol(Execute);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6592
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6593
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6594
			case VK_CANCEL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6595
			    arg = @symbol(Cancel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6596
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6597
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6598
			case VK_SELECT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6599
			    arg = @symbol(Select);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6600
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6601
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6602
			case VK_PRINT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6603
			    arg = @symbol(Print);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6604
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6605
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6606
			case VK_SNAPSHOT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6607
			    arg = @symbol(Snapshot);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6608
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6609
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6610
			case VK_INSERT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6611
			    arg = @symbol(Insert);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6612
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6613
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6614
			case VK_DELETE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6615
			    arg = @symbol(Delete);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6616
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6617
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6618
			case VK_BACK:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6619
			    arg = @symbol(BackSpace);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6620
			    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6621
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6622
			case VK_LWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6623
			    arg = @symbol(Win_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6624
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6625
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6626
			case VK_RWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6627
			    arg = @symbol(Win_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6628
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6629
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6630
			case VK_APPS:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6631
			    arg = @symbol(Appl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6632
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6633
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6634
			case VK_NUMPAD0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6635
			    arg = @symbol(KeyPad0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6636
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6637
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6638
			case VK_NUMPAD1:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6639
			    arg = @symbol(KeyPad1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6640
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6641
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6642
			case VK_NUMPAD2:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6643
			    arg = @symbol(KeyPad2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6644
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6645
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6646
			case VK_NUMPAD3:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6647
			    arg = @symbol(KeyPad3);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6648
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6649
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6650
			case VK_NUMPAD4:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6651
			    arg = @symbol(KeyPad4);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6652
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6653
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6654
			case VK_NUMPAD5:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6655
			    arg = @symbol(KeyPad5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6656
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6657
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6658
			case VK_NUMPAD6:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6659
			    arg = @symbol(KeyPad6);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6660
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6661
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6662
			case VK_NUMPAD7:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6663
			    arg = @symbol(KeyPad7);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6664
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6665
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6666
			case VK_NUMPAD8:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6667
			    arg = @symbol(KeyPad8);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6668
			    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6669
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6670
			case VK_NUMPAD9:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6671
			    arg = @symbol(KeyPad9);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6672
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6673
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6674
			case VK_LSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6675
			    arg = @symbol(Shift_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6676
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6677
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6678
			case VK_RSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6679
			    arg = @symbol(Shift_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6680
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6681
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6682
			case VK_LCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6683
			    arg = @symbol(Ctrl_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6684
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6685
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6686
			case VK_RCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6687
			    arg = @symbol(Ctrl_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6688
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6689
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6690
			case VK_CONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6691
			    arg = @symbol(Ctrl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6692
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6693
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6694
			case VK_SHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6695
			    arg = @symbol(Shift);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6696
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6697
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6698
			case VK_TAB:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6699
			    arg = @symbol(Tab);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6700
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6701
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6702
			case VK_ESCAPE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6703
			    arg = @symbol(Escape);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6704
			    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6705
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6706
			case VK_NUMLOCK:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6707
			    arg = @symbol(NumLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6708
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6709
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6710
			case VK_SCROLL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6711
			    arg = @symbol(ScrollLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6712
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6713
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6714
			case VK_RETURN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6715
			    arg = @symbol(Return);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6716
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6717
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6718
			default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6719
			    nameBuffer[0] = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6720
			    /*GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6721
			    DPRINTF(("char is <%d>\n", keyCode));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6722
			    arg = __MKCHARACTER(keyCode & 0xFF);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6723
			    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6724
		    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6725
		 }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6726
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6727
		DPRINTF(("%s: code=%x mod=%x\n", __stringVal(symS),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6728
				keyCode, modifiers));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6729
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6730
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6731
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6732
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6733
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6734
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6735
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6736
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6737
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6738
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6739
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6740
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6741
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6742
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6743
	    default:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6744
		DPRINTF((">>> unhandled event: %x\n", ev->ev_message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6745
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6746
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6747
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6748
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6749
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6750
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6751
dispatchPendingEvents
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6752
    "central event handling method for modal operation.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6753
     (i.e. this is now only used in the modal debugger)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6754
     Dispatch any pending events; return when no more are pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6755
     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
  6756
     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
  6757
     we only handle exposes until the graphicsExpose arrives.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6758
     Other systems may not need such a kludge"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6759
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6760
    "interested in exposes only ?"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6761
    dispatchingExpose notNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6762
	[self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6763
	    self dispatchExposeEventFor:dispatchingExpose
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6764
	].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6765
	^ self
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6766
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6767
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6768
    [self eventPendingWithSync:false] whileTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6769
	(self getEventFor:nil withMask:nil) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6770
	    AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6771
		ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6772
	    ] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6773
		self dispatchLastEvent
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6774
	    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6775
	].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6776
    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6777
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6778
    "Modified: 19.8.1997 / 17:11:18 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6779
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6780
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6781
disposeEventsWithMask:aMask for:aWindowIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6782
    "dispose (throw away) specific events. If aWindowId is nil,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6783
     events matching the mask are thrown away regardless of which
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6784
     view they are for. Otherwise, only matching events for that
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6785
     view are flushed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6786
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6787
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6788
   PRINTF(("disposeEventsWithMask:for: not yet implemented.\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6789
   RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6790
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6791
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6792
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6793
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6794
eventMaskFor:anEventSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6795
    "return the eventMask bit-constant corresponding to an event symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6796
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6797
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6798
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6799
    int m = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6800
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6801
    if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6802
    else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6803
    else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6804
    else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6805
    else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6806
    else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6807
    else if (anEventSymbol == @symbol(expose)) m = ExposureMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6808
    else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6809
    else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6810
    else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6811
    else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6812
    else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6813
    else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6814
    else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6815
    else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6816
    else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6817
    RETURN (__MKSMALLINT(m));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6818
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6819
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6820
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6821
eventPending
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6822
    "return true, if any event is pending.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6823
     This looks for both the internal queue and the display connection."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6824
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6825
    ConservativeSyncing == true ifTrue:[self sync].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6826
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6827
    dispatchingExpose notNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6828
	^ self exposeEventPendingFor:dispatchingExpose withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6829
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6830
    ^ self eventPendingWithSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6831
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6832
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6833
eventPending:anEventSymbol for:aWindowIdOrNil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6834
    "return true, if a specific event is pending"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6835
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6836
    ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6837
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6838
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6839
eventPendingWithSync:doSync
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6840
    "return true, if any event is pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6841
     The doSync argument is ignored here - in windows, all drawing is synchronous."
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6842
    doSync notNil ifTrue:[self flush].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6843
%{  /* xxLIMITEDSTACK (WIN95 only) */
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6844
    MSG msg;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6845
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6846
    if (__INST(inRecursiveDispatch) == true) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6847
	RETURN (false);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6848
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6849
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6850
    if (isInputEvent()) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6851
	RETURN (true);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6852
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6853
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6854
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6855
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6856
eventQueued
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6857
    "return true, if any event is queued"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6858
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6859
    ^ self eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6860
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6861
    "Created: 12.12.1995 / 21:43:00 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6862
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6863
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6864
eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6865
    "return true, if any event is queued internally.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6866
     (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
  6867
      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
  6868
      the display connection)."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6869
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6870
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6871
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6872
    DDPRINTF(("peek q - "));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6873
    if (isInputEvent()) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6874
	DDPRINTF(("true\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6875
	RETURN (true);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6876
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6877
    DDPRINTF(("false\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6878
    RETURN ( false );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6879
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6880
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6881
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6882
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6883
    "return true, if any of the masked events is pending.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6884
     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
  6885
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6886
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6887
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6888
    DPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6889
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6890
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6891
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6892
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6893
exposeEventPendingFor:aWindowIdOrNil withSync:doSync
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6894
    "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
  6895
     or any view (if the arg is nil).
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6896
     This is an X specific interface - not used on windows (scrolling is synchronous)"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6897
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6898
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6899
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6900
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6901
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6902
getEventFor:aViewIdOrNil withMask:eventMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6903
    "read next event - put into local eventBuffer.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6904
     If aViewIdOrNil is nil, events for any view are fetched;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6905
     otherwise only events for that specific view will be fetched.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6906
     Returns true, if there was an event, false otherwise."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6907
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6908
%{  /* xxLIMITEDSTACK */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6909
    HWND win, wWanted;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6910
    int evMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6911
    OBJ eB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6912
    struct queuedEvent *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6913
    struct queuedEvent *qev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6914
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6915
    if (__isByteArray(eB)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6916
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6917
    } else {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6918
	printf("DISPLAY: no eventBuffer\n");
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6919
	RETURN (false);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6920
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6921
    ev->ev_message = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6922
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6923
    if (__isSmallInteger(eventMask)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6924
	evMask = __intVal(eventMask);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6925
    } else {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6926
	evMask = ~0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6927
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6928
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6929
    if (__isExternalAddress(aViewIdOrNil))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6930
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6931
	if (deqEvent(ev,_HWNDVal(aViewIdOrNil),evMask))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6932
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6933
	  RETURN ( true );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6934
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6935
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6936
    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6937
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6938
	if (deqEvent(ev,0,evMask))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6939
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6940
	  RETURN ( true );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6941
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6942
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6943
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6944
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6945
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6946
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6947
handleAllEvents
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6948
    "from now on, handle any kind of event"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6949
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6950
    dispatchingExpose := nil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6951
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6952
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6953
handleExposeOnlyFor:aView
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6954
    "from now on, handle expose events only"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6955
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6956
    dispatchingExpose := aView id
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6957
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6958
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6959
mappingChanged:what event:eB
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6960
    "One of Keyboard-, Modifier- or PointerMap has change, probably by xmodmap.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6961
     Tell xlib about the fact."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6962
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6963
    (what == #mappingKeyboard or:[what == #mappingModifier]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6964
	self refreshKeyboardMapping:eB.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6965
	"Maybe some of our modifiers have been changed"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6966
	self initializeModifierMappings.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6967
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6968
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6969
    "Created: 1.12.1995 / 16:28:23 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6970
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6971
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6972
setEventMask:aMask in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6973
    "tell X that we are only interested in events from aMask, which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6974
     is the bitwise or of the eventMask bits (see 'eventMaskFor:')"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6975
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6976
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6977
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6978
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6979
	&& __isSmallInteger(aMask))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6980
    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6981
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6982
	int mask = __intVal(aMask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6983
	if (GETLOCALWINDOWINFOPTR(hWnd))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6984
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6985
	  DPRINTF(("new eventMask %x\n",mask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6986
#ifdef DEBUGMASK
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6987
	  PRINTF(("new eventMask %x\n",mask));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6988
	  printMask(mask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6989
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6990
	  GETLOCALWINDOWINFOPTR(hWnd)->eventMask = mask;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6991
	  RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6992
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6993
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6994
%}.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6995
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6996
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6997
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6998
!WinWorkstation methodsFor:'event sending'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6999
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7000
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
  7001
    "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
  7002
     TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7003
     For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7004
     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
  7005
     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
  7006
     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
  7007
     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
  7008
     (not very user friendly)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7009
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7010
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7011
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7012
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7013
simulateKeyboardInput:aCharacterOrString inViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7014
    "send input to some other view, by simulating keyPress/keyRelease
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7015
     events.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7016
     Only a few control characters are supported.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7017
     Notice: not all alien views allow this kind of synthetic input;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7018
	     some simply ignore it."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7019
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7020
    |control code state|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7021
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7022
    aCharacterOrString isString ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7023
	aCharacterOrString do:[:char |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7024
	    self simulateKeyboardInput:char inViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7025
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7026
	^ self
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7027
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7028
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7029
    control := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7030
    code := aCharacterOrString asciiValue.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7031
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7032
    (aCharacterOrString == Character cr) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7033
	code := #Return
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7034
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7035
	(aCharacterOrString == Character tab) ifTrue:[
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7036
	    code := #Tab
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7037
	] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7038
	    (aCharacterOrString == Character esc) ifTrue:[
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7039
		code := #Escape
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7040
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7041
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7042
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7043
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7044
    control ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7045
	state := self controlMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7046
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7047
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7048
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7049
    "/ the stuff below should not be needed 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7050
    "/ (sendKeyOrButtonevent should be able to figure out things itself)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7051
    "/ however, on some linux systems it seems to not work correctly.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7052
    "/ Hopefully, this is correct ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7053
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7054
    code isNumber ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7055
	code >= $A asciiValue ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7056
	    code <= $Z asciiValue ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7057
		state := self shiftMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7058
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7059
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7060
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7061
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7062
    self sendKeyOrButtonEvent:#keyPress x:0 y:0 keyOrButton:code state:state toViewId:viewId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7063
    self sendKeyOrButtonEvent:#keyRelease x:0 y:0 keyOrButton:code state:state toViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7064
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7065
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7066
      sending input to some (possibly alien) view:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7067
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7068
      |point id|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7069
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7070
      point :=  Display pointFromUser.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7071
      id := Display viewIdFromPoint:point.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7072
      Display simulateKeyboardInput:'Hello_world' inViewId:id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7073
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7074
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7075
    "Modified: 11.6.1996 / 10:59:42 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7076
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7077
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7078
!WinWorkstation methodsFor:'font stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7079
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7080
createFontFor:aFontName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7081
    "a basic method for font allocation; this method allows
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7082
     any font to be aquired (even those not conforming to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7083
     standard naming conventions, such as cursor, fixed or k14)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7084
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7085
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7086
    HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7087
    char *fn;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7088
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7089
    if (__isString(aFontName)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7090
	fn = __stringVal(aFontName);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7091
	if (strcmp(fn, "fixed") == 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7092
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7093
	} else if (strcmp(fn, "variable") == 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7094
	    hFont = GetStockObject(ANSI_VAR_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7095
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7096
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7097
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7098
	if (hFont) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7099
	    DPRINTF(("createFontFor:aFontName: %s -> %x\n", fn, hFont));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7100
	    RETURN ( __MKOBJ(hFont) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7101
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7102
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7103
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7104
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7105
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7106
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7107
fontMetricsOf:fontId into:aBlock
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7108
    "evaluate aBlock, passing a fonts metrics as arguments"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7109
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7110
    |data|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7111
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7112
    data := Array new:10.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7113
    (self primFontMetricsOf:fontId intoArray:data) isNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7114
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7115
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7116
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7117
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7118
    aBlock value:#iso8859
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7119
	   value:(data at:1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7120
	   value:(data at:2)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7121
	   value:(data at:3)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7122
	   value:(data at:4)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7123
	   value:(data at:5)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7124
	   value:(data at:6)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7125
	   value:(data at:7)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7126
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7127
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7128
fontsInFamily:aFamilyName face:aFaceName filtering:filter
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7129
    "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
  7130
     On WinWorkStations there is curently Face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7131
     But only thise matching filter (if nonNil)."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7132
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7133
    |allFonts fonts|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7134
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7135
    allFonts := self listOfAvailableFonts.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7136
    allFonts isNil ifTrue:[^ nil].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7137
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7138
    fonts := Set new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7139
    allFonts do:[:fntDescr |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7140
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7141
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7142
		fonts add:fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7143
	    ]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7144
	]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7145
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7146
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7147
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7148
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7149
fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7150
    "return a set of all available font in aFamily/aFace/aStyle
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7151
     on this display.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7152
     On WinWorkStations there is curently no style or Face
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7153
     But only those matching filter (if nonNIl)."
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7154
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7155
    |allFonts fonts|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7156
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7157
    allFonts := self listOfAvailableFonts.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7158
    allFonts isNil ifTrue:[^ nil].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7159
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7160
    fonts := Set new.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7161
    allFonts do:[:fntDescr |
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7162
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7163
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7164
		fonts add:fntDescr
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7165
	    ]
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7166
	]
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7167
    ].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7168
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7169
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7170
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7171
fullNameOf:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7172
    "the fonts fullName - this is very device specific and should only be
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7173
     used for user feed-back (for example: in the fontPanel).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7174
     If the display/font do not provide that info, return nil."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7175
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7176
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7177
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7178
getAvailableFontsMatching:pattern
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7179
    "return an Array filled with font names matching aPattern"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7180
    self halt.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7181
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7182
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7183
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7184
getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7185
    "return a default font id - used when class Font cannot
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7186
     find anything usable"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7187
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7188
     ^ self createFontFor:'fixed'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7189
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7190
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7191
getFontWithFamily:familyString face:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7192
	    style:styleArgString size:sizeArg encoding:encodingSym
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7193
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7194
    "try to get the specified font, if not available, try next smaller
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7195
     font. Access to X-fonts by name is possible, by passing the X font name
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7196
     as family and the other parameters as nil. For example, the cursor font
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7197
     can be aquired that way."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7198
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7199
    |styleString theName theId xlatedStyle id spacing|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7200
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7201
    styleString := styleArgString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7202
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7203
    "special: if face is nil, allow access to X-fonts"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7204
    faceString isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7205
	sizeArg notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7206
	    theName := familyString , '-' , sizeArg printString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7207
	] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7208
	    theName := familyString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7209
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7210
	theName isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7211
	    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7212
	     mhmh - fall back to the default font
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7213
	    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7214
	    theName := 'fixed'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7215
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7216
	theId := self createFontFor:theName.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7217
	theId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7218
	    theId := self getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7219
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7220
	^ theId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7221
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7222
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7223
    "/ spacing other than 'normal' is contained as last component
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7224
    "/ in style
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7225
    styleString notNil ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7226
	((styleString endsWith:'-narrow')
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7227
	 or:[styleString endsWith:'-semicondensed']) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7228
	    |i|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7229
	    i := styleString lastIndexOf:$-.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7230
	    spacing := styleString copyFrom:(i+1).
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7231
	    styleString := styleString copyTo:(i-1).
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7232
	] ifFalse:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7233
	    spacing := 'normal'.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7234
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7235
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7236
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7237
    xlatedStyle := styleString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7238
    xlatedStyle notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7239
	xlatedStyle := xlatedStyle first asString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7240
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7241
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7242
    id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7243
	    getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7244
	    family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7245
	    weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7246
	    slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7247
	    spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7248
	    pixelSize:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7249
	    size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7250
	    registry:encodingSym
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7251
	    encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7252
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7253
    id isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7254
	(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7255
	    "/ too stupid: encodings come in both cases
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7256
	    "/ and X does not ignore case
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7257
	    "/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7258
	    id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7259
		    getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7260
		    family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7261
		    weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7262
		    slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7263
		    spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7264
		    pixelSize:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7265
		    size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7266
		    registry:encodingSym asUppercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7267
		    encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7268
	    id isNil ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7269
		id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7270
			getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7271
			family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7272
			weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7273
			slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7274
			spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7275
			pixelSize:nil
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7276
			size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7277
			registry:encodingSym asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7278
			encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7279
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7280
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7281
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7282
    ^ id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7283
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7284
    "Modified: 24.2.1996 / 22:37:24 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7285
    "Modified: 4.7.1996 / 11:38:47 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7286
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7287
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7288
getFontWithFoundry:foundry family:family weight:weight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7289
	      slant:slant spacing:spc pixelSize:pSize size:size
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7290
	      registry:registry encoding:encoding
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7291
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7292
    "get the specified font, if not available, return nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7293
     This is the new font creation method - all others will be changed to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7294
     use this entry.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7295
     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
  7296
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7297
     foundry: 'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7298
     family:  'helvetica' 'courier' 'times' ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7299
     weight:  'bold' 'medium' 'demi' ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7300
     slant:   'r(oman)' 'i(talic)' 'o(blique)'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7301
     spacing: 'narrow' 'normal' semicondensed' ... usually '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7302
     pixelSize: 16,18 ... usually left empty
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7303
     size:      size in point (1/72th of an inch)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7304
     registry:  iso8859, sgi ... '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7305
     encoding:  vendor specific encoding (usually '*')
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7306
    "
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7307
    "
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7308
	Windows 95 allows the creation of a font with the following parameters
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7309
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7310
		nHeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7311
		nWidth
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7312
		nEscapement
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7313
		nOrientation
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7314
		fnWeight        FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7315
		fdwItalic       TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7316
		fdwUnderline    TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7317
		fdwStrikeOut    TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7318
		fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7319
		fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7320
		fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7321
		fdwQuality      DEFAULT, DRAFT, or PROOF.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7322
		fdwPitchAndFamily
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7323
			DEFAULT, FIXED or VARIABLE pitch
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7324
			DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7325
		lpszFace
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7326
			Typeface Name
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7327
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7328
	These two above descriptions will be matched as follows:
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7329
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7330
		foundry - ignored
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7331
		family  - mapped to type face name.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7332
		weight  - mapped to fnWeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7333
		slant   - NOT USED INITIALLY  user for style
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7334
		spacing - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7335
		pixelSize - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7336
		size      - mapped to nHeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7337
		registry  - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7338
		encoding  - NOT USED INITIALLY used for dwType device, raster or truetype
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7339
	"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7340
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7341
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7342
    HGDIOBJ hFont;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7343
    int  nHeight, nWidth, nEscapement, nOrientation;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7344
    char* work;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7345
    char* work2;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7346
    DWORD fnWeight;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7347
    DWORD fdwItalic;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7348
    DWORD fdwUnderline;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7349
    DWORD fdwStrikeOut;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7350
    DWORD fdwCharSet;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7351
    DWORD fdwOutputPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7352
    DWORD fdwClipPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7353
    DWORD fdwQuality;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7354
    DWORD fdwPitchAndFamily;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7355
    LPCTSTR lpszFace;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7356
    static char temp[33];
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7357
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7358
/* INITIALIZE */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7359
    strcpy( temp, "                           " );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7360
    lpszFace = &temp[0];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7361
    strcpy( (char *)lpszFace, "NULL" );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7362
    nHeight  = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7363
    nWidth   = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7364
    nEscapement = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7365
    nOrientation = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7366
    fnWeight = FW_NORMAL;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7367
    fdwItalic = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7368
    fdwUnderline = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7369
    fdwStrikeOut = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7370
    fdwCharSet   = ANSI_CHARSET;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7371
    fdwOutputPrecision = OUT_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7372
    fdwClipPrecision   = CLIP_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7373
    fdwQuality         = DEFAULT_QUALITY;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7374
    fdwPitchAndFamily  = FF_DONTCARE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7375
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7376
/* SET VALUES */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7377
    if ( __isString( family ) ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7378
	work = __stringVal( family );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7379
	if ( strcmp( work, "nil" ) != 0 ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7380
	    strncpy( (char *)lpszFace, work, 32 );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7381
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7382
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7383
    if( __isString( weight ) ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7384
	work = __stringVal( weight );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7385
	if( strcmp( work, "bold" ) == 0 ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7386
	    fnWeight = FW_BOLD;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7387
    } else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7388
	if( strcmp( work, "medium" ) == 0 ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7389
	    fnWeight = FW_MEDIUM;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7390
	    } else {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7391
		if( strcmp( work, "demi" ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7392
		    fnWeight = FW_LIGHT;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7393
	    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7394
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7395
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7396
    if(__isSmallInteger( size ) )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7397
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7398
	nHeight = __intVal( size );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7399
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7400
    work2 = __stringVal( slant );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7401
    work  = __stringVal( slant );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7402
    if( strncmp( work2, "italic", 6 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7403
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7404
	fdwItalic = TRUE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7405
	if( work2[6] = '-' )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7406
	   strncpy( work, &work2[7], ( strlen( work2 ) - 7 ) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7407
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7408
    if( strncmp( work, "underline", 9 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7409
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7410
	fdwUnderline = TRUE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7411
	if( work[10] == '-' )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7412
	   strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7413
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7414
    if( strncmp( work2, "strikeOut", 9 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7415
	fdwStrikeOut = TRUE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7416
    nHeight = -MulDiv(nHeight, __logPixelSY, 72);
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
    DPRINTF(("CreateFont %s h=%d\n",lpszFace,nHeight));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7419
    hFont = CreateFont( nHeight,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7420
			nWidth,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7421
			nEscapement,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7422
			nOrientation,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7423
			fnWeight,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7424
			fdwItalic,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7425
			fdwUnderline,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7426
			fdwStrikeOut,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7427
			fdwCharSet,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7428
			fdwOutputPrecision,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7429
			fdwClipPrecision,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7430
			fdwQuality,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7431
			fdwPitchAndFamily,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7432
			lpszFace );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7433
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7434
    if( hFont != NULL )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7435
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7436
	DPRINTF(("createFontWithFoundry: %x\n", hFont));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7437
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7438
	    __cnt_font++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7439
	   RES1PRINTF(("CreateFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7440
#endif
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7441
	RETURN ( __MKOBJ(hFont) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7442
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7443
    DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7444
%}.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7445
    ^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7446
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7447
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7448
     Display getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7449
			 family:'courier'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7450
			 weight:'medium'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7451
			  slant:'r'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7452
			spacing:nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7453
		      pixelSize:nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7454
			   size:13
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7455
		       registry:'iso8859'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7456
		       encoding:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7457
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7458
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7459
    "new NT Version: 20.2.1997 / 22:33:29 / dq"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7460
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7461
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7462
listOfAvailableFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7463
    "return a list with all available fonts on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7464
     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
  7465
     next time. The elements of the returned collection are instances of
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7466
     FontDescription."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7467
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7468
    |list typeFaceList|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7469
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7470
    listOfFonts notNil ifTrue:[^ listOfFonts].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7471
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7472
    list := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7473
    typeFaceList := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7474
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7475
    [
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7476
      self primEnumFontTypesInto:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7477
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7478
      "/Transcript showCR:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7479
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7480
      typeFaceList do:[:typeFace |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7481
	  self primEnumFontsIn:typeFace into:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7482
	  0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7483
      ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7484
    ] valueUninterruptably.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7485
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7486
    "/Transcript showCR:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7487
    listOfFonts := list
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7488
		       collect:[:anArray |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7489
			| fntDescr family face style size encoding |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7490
			family := anArray at:14.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7491
			face   := anArray at:5.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7492
			style  := anArray at:16.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7493
			size   := anArray at:1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7494
			encoding := anArray at:15.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7495
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7496
			fntDescr := FontDescription
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7497
					family:family
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7498
					face:face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7499
					style:style
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7500
					size:size
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7501
					encoding:encoding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7502
			fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7503
		       ].
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7504
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7505
    ^ listOfFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7506
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7507
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7508
     Display listOfAvailableFonts.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7509
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7510
     Display getAvailableFontsMatching:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7511
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7512
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7513
    "Modified: 27.9.1995 / 10:54:47 / stefan"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7514
    "Modified: 17.4.1996 / 15:27:57 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7515
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7516
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7517
primEnumFontTypesInto:typeFaceList
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7518
%{      /* xxLIMITEDSTACK (WIN95) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7519
	if (tmpDC)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7520
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7521
	    if ( EnumFontFamilies( tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7522
		DPRINTF(("EnumFonts successful\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7523
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7524
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7525
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7526
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7527
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7528
primEnumFontsIn:typeFace into:fontList
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7529
%{      /* xxLIMITEDSTACK (WIN95) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7530
	char *cp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7531
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7532
	if (__isString(typeFace))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7533
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7534
	    if (tmpDC) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7535
		if (EnumFontFamilies(tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7536
		    DPRINTF(("EnumFonts Successful\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7537
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7538
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7539
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7540
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7541
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7542
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7543
primFontMetricsOf:fontId intoArray:data
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7544
    "evaluate aBlock, passing a fonts metrics as arguments"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7545
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7546
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7547
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7548
    if (__isExternalAddress(fontId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7549
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7550
	SIZE size;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7551
	int avgWidth;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7552
	HGDIOBJ hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7553
	HGDIOBJ prevFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7554
	TEXTMETRIC tmet;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7555
	int len;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7556
	hFont = _HGDIOBJVal(fontId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7557
	/*
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7558
	 * temporarily set this font in the root context
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7559
	 */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7560
	prevFont = SelectObject(tmpDC, hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7561
	GetTextMetrics(tmpDC, &tmet);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7562
	GetTextExtentPoint32(tmpDC,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7563
	 "uvwxyz",52,&size);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7564
	SelectObject(tmpDC, prevFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7565
	avgWidth = (size.cx/26+1)/2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7566
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7567
	__ArrayInstPtr(data)->a_element[0] = __MKSMALLINT(tmet.tmAscent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7568
	__ArrayInstPtr(data)->a_element[1] = __MKSMALLINT(tmet.tmDescent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7569
	__ArrayInstPtr(data)->a_element[2] = __MKSMALLINT(tmet.tmAscent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7570
	__ArrayInstPtr(data)->a_element[3] = __MKSMALLINT(tmet.tmDescent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7571
	__ArrayInstPtr(data)->a_element[4] = __MKSMALLINT(avgWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7572
	__ArrayInstPtr(data)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7573
	__ArrayInstPtr(data)->a_element[6] = __MKSMALLINT(avgWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7574
	DPRINTF(("textMetrics h=%x  avgAsc=%d avgDesc=%d minW=%d maxW=%d avgW=%d\n",
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7575
		    hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7576
		    tmet.tmAveCharWidth));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7577
	RETURN (self);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7578
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7579
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7580
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7581
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7582
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7583
releaseFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7584
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7585
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7586
    if (__isExternalAddress(aFontId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7587
	HGDIOBJ hFont = _HGDIOBJVal(aFontId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7588
	if (hFont)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7589
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7590
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7591
	    __cnt_font--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7592
	   RES1PRINTF(("DestroyFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7593
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7594
	  DelObject(hFont);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7595
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7596
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7597
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7598
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7599
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7600
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7601
    "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
  7602
     on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7603
     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
  7604
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7605
    |sizes|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7606
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7607
    sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7608
    (sizes notNil and:[sizes includes:0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7609
	"special: in X11R5 and above, size 0 means:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7610
	 there are scaled versions in all sizes available"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7611
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7612
	^ #(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
  7613
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7614
    ^ sizes
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
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7617
     Display sizesInFamily:'courier' face:'bold' style:'roman'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7618
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7619
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7620
    "Created: 27.2.1996 / 01:38:15 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7621
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7622
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7623
widthOf:aString from:index1 to:index2 inFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7624
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7625
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7626
    char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7627
    int len, n, i1, i2, l;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7628
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7629
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7630
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7631
	if (__bothSmallInteger(index1, index2)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7632
	 && __isExternalAddress(aFontId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7633
	 && __isNonNilObject(aString)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7634
	    HGDIOBJ hFont,prevFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7635
	    SIZE tsize;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7636
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7637
	    hFont = _HGDIOBJVal(aFontId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7638
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7639
	    i1 = __intVal(index1) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7640
	    cls = __qClass(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7641
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7642
	    if (i1 >= 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7643
		i2 = __intVal(index2) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7644
		if (i2 < i1) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7645
		    RETURN ( __MKSMALLINT( 0 ) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7646
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7647
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7648
		cp = (char *) _stringVal(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7649
		l = i2 - i1 + 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7650
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7651
		if ((cls == @global(String)) || (cls == @global(Symbol))) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7652
		    n = _stringSize(aString);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7653
		    if (i2 < n)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7654
		    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7655
			cp += i1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7656
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7657
			prevFont = SelectObject(tmpDC, hFont);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7658
			GetTextExtentPoint32(tmpDC, cp, l, &tsize);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7659
#ifdef DEBUG
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7660
			if (__debug__)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7661
			{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7662
			  char buf[80];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7663
			  GetTextFace(tmpDC,80,buf);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7664
			  printf("font1 %x %s >%s< l=%d dx=%d\n",hFont,buf,cp,l,tsize.cx);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7665
			}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7666
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7667
			SelectObject(tmpDC, prevFont);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7668
			RETURN ( __MKSMALLINT(tsize.cx) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7669
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7670
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7671
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7672
		nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7673
		cp += nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7674
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7675
		if (__isBytes(aString)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7676
		    n = __byteArraySize(aString) - nInstBytes;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7677
		    if (i2 < n)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7678
		    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7679
			cp += i1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7680
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7681
			prevFont = SelectObject(tmpDC, hFont);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7682
			GetTextExtentPoint32(tmpDC, cp, l, &tsize);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7683
#ifdef DEBUG
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7684
			if (__debug__)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7685
			{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7686
			  char buf[80];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7687
			  GetTextFace(tmpDC,80,buf);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7688
			  printf("font1 %x %s >%s< l=%d dx=%d\n",hFont,buf,cp,l,tsize.cx);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7689
			}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7690
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7691
			SelectObject(tmpDC, prevFont);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7692
			RETURN ( __MKSMALLINT(tsize.cx) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7693
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7694
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7695
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7696
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7697
#undef NLOCALBUFFER
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7698
%}.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7699
"/  'no stringlen' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7700
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7701
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7702
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7703
!WinWorkstation methodsFor:'grabbing '!
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
allowEvents:mode
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7706
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7707
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7708
grabKeyboardIn:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7709
    "grab the keyboard"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7710
%{    
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7711
    if (__isExternalAddress(aWindowId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7712
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7713
      HWND hWnd = _HWNDVal(aWindowId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7714
      CPRINTF(("grabKeyboard in %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7715
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7716
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7717
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7718
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7719
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7720
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7721
    "grap the pointer - return true if ok"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7722
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7723
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7724
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7725
	HWND hWnd = _HWNDVal(aWindowId);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7726
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7727
          HCURSOR hCursor = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7728
	  if (currentCapture != CAPTURE_NONE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7729
	  {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7730
            PostMessage(currentPointerView,WM_THREADSETCAPTURE,0,0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7731
	    //ReleaseCapture();
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7732
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7733
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7734
	  if (hWnd == __rootWin)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7735
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7736
	     hWnd = __rootWinSpezial;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7737
	     ShowWindow(hWnd,SW_SHOWNOACTIVATE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7738
	     CPRINTF(("setRootCapture %x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7739
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7740
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7741
	  if (__isExternalAddress(aCursorId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7742
	  {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7743
	      hCursor = _HCURSORVal(aCursorId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7744
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7745
          CPRINTF(("grabPointerIn  SetCapture %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7746
          PostMessage(hWnd,WM_THREADSETCAPTURE,(INT)hWnd,(INT)hCursor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7747
	  if (__isExternalAddress(aCursorId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7748
	  {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7749
	      RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7750
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7751
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7752
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7753
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7754
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7755
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7756
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7757
ungrabKeyboard
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7758
    "release the keyboard"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7759
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7760
    activeKeyboardGrab := nil.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7761
%{    
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7762
    CPRINTF(("ungrabKeyboard\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7763
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7764
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7765
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7766
ungrabPointer
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7767
    "release the pointer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7768
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7769
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7770
    CPRINTF(("ungrabPointer 1\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7771
    PostThreadMessage(_dispatchThreadId,WM_THREADSETCAPTURE,0,0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7772
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7773
    activePointerGrab := nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7774
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7775
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7776
!WinWorkstation methodsFor:'graphic context stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7777
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7778
noClipIn:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7779
    "disable clipping rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7780
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7781
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7782
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7783
    if (__isExternalAddress(aWindowId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7784
     && __isExternalAddress(aGCId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7785
     {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7786
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7787
	gcData->clipping = FALSE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7788
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7789
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7790
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7791
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7792
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7793
setBackground:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7794
    "set background color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7795
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7796
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7797
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7798
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7799
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7800
    if (__isExternalAddress(aGCId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7801
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7802
	COLORREF bgColor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7803
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7804
	//hDC = _getDC(gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7805
	bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7806
	if (bgColor != gcData->bgColor) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7807
	    gcData->bgColor = bgColor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7808
	    SetBkColor(hDC, bgColor);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7809
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7810
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7811
	DPRINTF(("setBackground: %x\n", bgColor));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7812
	//_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7813
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7814
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7815
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7816
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7817
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7818
setBitmapMask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7819
    "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
  7820
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7821
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7822
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7823
    if (__isExternalAddress(aGCId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7824
    {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7825
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7826
	//HDC hDC = _getDC(gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7827
	if (__isExternalAddress(aBitmapId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7828
	  gcData->hMask = _HBITMAPVAL(aBitmapId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7829
	else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7830
	  gcData->hMask = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7831
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7832
	DPRINTF(("masks set to %x\n",gcData->hMask));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7833
	//_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7834
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7835
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7836
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7837
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7838
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7839
setClipByChildren:aBool in:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7840
    "enable/disable drawing into child views"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7841
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7842
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7843
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7844
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7845
    if (ISCONNECTED && __isExternalAddress(aGCId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7846
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7847
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7848
	if (gcData && gcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7849
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7850
	    if( aBool == true )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7851
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7852
		/* set clip by child */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7853
		if (gcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7854
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7855
		  gcData->clipByChild = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7856
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7857
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7858
	    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7859
		if (gcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7860
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7861
		  gcData->clipByChild = FALSE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7862
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7863
	    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7864
	} else {
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7865
	    DPRINTF(("clipping by child failed - invalid win\n" ));
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7866
	}
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7867
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7868
%}.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7869
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7870
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7871
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7872
setClipX:clipX y:clipY width:clipWidth height:clipHeight in:aDrawableId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7873
    "clip to a rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7874
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7875
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7876
      p--w---
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7877
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7878
      h     |  the clipping rectangle
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7879
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7880
      -------
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7881
	  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
  7882
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7883
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7884
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7885
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7886
    /*RETURN (self);*/
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7887
    if (  __isExternalAddress(aGCId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7888
       && __bothSmallInteger(clipX, clipY)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7889
       && __bothSmallInteger(clipWidth, clipHeight) ) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7890
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7891
	gcData->clipping = TRUE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7892
	gcData->clipX = __intVal(clipX); 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7893
	gcData->clipY = __intVal(clipY); 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7894
	gcData->clipW = __intVal(clipWidth); 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7895
	gcData->clipH = __intVal(clipHeight); 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7896
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7897
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7898
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7899
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7900
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7901
setDashes:dashList dashOffset:offset in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7902
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7903
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7904
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7905
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7906
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7907
	PRINTF(("dashes not yet implemented\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7908
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7909
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7910
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7911
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7912
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7913
setFont:aFontId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7914
    "set font to be drawn in"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7915
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7916
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7917
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7918
    if (__isExternalAddress(aGCId)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7919
     && __isExternalAddress(aFontId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7920
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7921
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7922
	HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7923
	HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7924
	TEXTMETRIC tmet;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7925
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7926
	hDC = _getDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7927
	hFont = _HGDIOBJVal(aFontId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7928
	gcData->hFont = hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7929
	hFont = SelectObject(hDC, hFont);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7930
	GetTextMetrics(hDC, &tmet);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7931
	gcData->fontAscent = tmet.tmAscent;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7932
#ifdef DEBUG
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7933
	if (__debug__)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7934
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7935
	  char buf[80];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7936
	  GetTextFace(hDC,80,buf);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7937
	  PRINTF(("setFont: %x %s\n", hFont,buf));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7938
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7939
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7940
	SelectObject(hDC, hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7941
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7942
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7943
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7944
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7945
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7946
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7947
setForeground:fgColorIndex background:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7948
    "set foreground and background colors to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7949
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7950
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7951
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7952
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7953
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7954
    if (__isExternalAddress(aGCId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7955
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7956
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7957
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7958
	gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7959
	DPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7960
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7961
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7962
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7963
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7964
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7965
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7966
    "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
  7967
     solid (if aBitmapId is nil)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7968
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7969
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7970
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7971
    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7972
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7973
    if (__isExternalAddress(aGCId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7974
    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7975
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7976
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7977
	gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7978
	if (__isExternalAddress(aBitmapId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7979
	  gcData->hMask = _HBITMAPVAL(aBitmapId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7980
	else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7981
	  gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7982
	DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7983
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7984
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7985
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7986
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7987
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7988
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId lineWidth:lw in:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7989
    "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
  7990
     solid (if aBitmapId is nil); also set lineWidth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7991
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7992
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7993
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7994
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7995
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7996
    if (__isExternalAddress(aGCId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7997
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7998
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7999
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8000
	gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8001
	gcData->lineWidth = __intVal(lw);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8002
	if (__isExternalAddress(aBitmapId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8003
	  gcData->hMask = _HBITMAPVAL(aBitmapId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8004
	else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8005
	  gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8006
	DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8007
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8008
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8009
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8010
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8011
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8012
setForeground:fgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8013
    "set foreground color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8014
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8015
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8016
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8017
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8018
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8019
    if (__isExternalAddress(aGCId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8020
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8021
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8022
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8023
	DDPRINTF(("setForeground: %x\n", fgColor));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8024
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8025
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8026
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8027
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8028
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8029
setFunction:aFunctionSymbol in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8030
    "set alu function to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8031
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8032
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8033
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8034
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8035
    if (__isExternalAddress(aGCId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8036
    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8037
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8038
	int fun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8039
	int bfun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8040
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8041
	if (aFunctionSymbol == @symbol(copy))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8042
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8043
	  fun = R2_COPYPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8044
	  bfun = BITBLT_COPY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8045
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8046
	else if (aFunctionSymbol == @symbol(copyInverted))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8047
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8048
	  fun = R2_NOTCOPYPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8049
	  bfun = BITBLT_COPYINVERTED;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8050
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8051
	else if (aFunctionSymbol == @symbol(xor))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8052
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8053
	  fun = R2_XORPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8054
	  bfun = BITBLT_XOR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8055
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8056
	else if (aFunctionSymbol == @symbol(and))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8057
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8058
	  fun = R2_MASKPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8059
	  bfun = BITBLT_AND;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8060
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8061
	else if (aFunctionSymbol == @symbol(or))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8062
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8063
	  fun = R2_MERGEPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8064
	  bfun = BITBLT_OR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8065
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8066
	if (fun != -1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8067
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8068
#if 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8069
	    printf("set func to");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8070
	    switch (bfun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8071
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8072
	      case BITBLT_COPY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8073
		printf("BITBLT_COPY\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8074
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8075
	      case BITBLT_COPYINVERTED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8076
		printf("BITBLT_COPYINVERTED\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8077
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8078
	      case BITBLT_XOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8079
		printf("BITBLT_XOR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8080
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8081
	      case BITBLT_AND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8082
		printf("BITBLT_AND\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8083
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8084
	      case BITBLT_OR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8085
		printf("BITBLT_OR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8086
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8087
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8088
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8089
	    gcData->rop2 = fun;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8090
	    gcData->bitbltrop2 = bfun;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8091
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8092
	else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8093
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8094
	    printf("unsuported Rasterfunction\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8095
	    gcData->rop2 = R2_COPYPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8096
	    gcData->bitbltrop2 = BITBLT_COPY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8097
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8098
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8099
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8100
    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8101
      printf("Rasterfunction no GC\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8102
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8103
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8104
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8105
setGraphicsExposures:aBoolean in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8106
    "set or clear the graphics exposures flag"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8107
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8108
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8109
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8110
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8111
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8112
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8113
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8114
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8115
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8116
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8117
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8118
     && __isSmallInteger(aNumber)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8119
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8120
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8121
	gcData->lineWidth = __intVal(aNumber);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8122
	if (lineStyle == @symbol(solid)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8123
	    gcData->lineStyle = PS_SOLID;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8124
	} else if (lineStyle == @symbol(dashed)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8125
	    gcData->lineStyle = PS_DASH;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8126
	} else
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8127
	    gcData->lineStyle = PS_SOLID;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8128
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8129
	if (capStyle == @symbol(round)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8130
	    gcData->capStyle = PS_ENDCAP_ROUND;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8131
	} else if (capStyle == @symbol(square)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8132
	    gcData->capStyle = PS_ENDCAP_SQUARE;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8133
	} else if (capStyle == @symbol(flat)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8134
	    gcData->capStyle = PS_ENDCAP_FLAT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8135
	} else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8136
	    gcData->capStyle = PS_ENDCAP_FLAT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8137
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8138
	if (joinStyle == @symbol(bevel)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8139
	    gcData->joinStyle = PS_JOIN_BEVEL;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8140
	} else if (joinStyle == @symbol(miter)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8141
	    gcData->joinStyle = PS_JOIN_MITER;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8142
	} else if (joinStyle == @symbol(round)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8143
	    gcData->joinStyle = PS_JOIN_ROUND;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8144
	} else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8145
	    gcData->joinStyle = PS_JOIN_MITER;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8146
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8147
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8148
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8149
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8150
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8151
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8152
setMaskOriginX:orgX y:orgY in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8153
    "set the mask origin"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8154
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8155
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8156
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8157
    if (__isExternalAddress(aGCId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8158
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8159
      if (__bothSmallInteger(orgX,orgY))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8160
      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8161
	struct gcData *gcData = _GCDATA(aGCId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8162
	int nXOrg = __intVal(orgX);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8163
	int nYOrg = __intVal(orgY);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8164
	HDC hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8165
	SetBrushOrgEx(hDC,nXOrg,nYOrg,0);       
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8166
	DPRINTF(("mask origin at x=%d y=%d\n",nXOrg,nYOrg));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8167
	_releaseDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8168
	RETURN (self);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8169
      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8170
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8171
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8172
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8173
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8174
setPixmapMask:aPixmapId in:aGCId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8175
    "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
  8176
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8177
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8178
    if (__isExternalAddress(aGCId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8179
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8180
	struct gcData *gcData = _GCDATA(aGCId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8181
	//HDC hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8182
	if (__isExternalAddress(aPixmapId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8183
	  gcData->hMask = _HBITMAPVAL(aPixmapId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8184
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8185
	  gcData->hMask = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8186
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8187
	DPRINTF(("PixmapMasks set to %x\n",gcData->hMask));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8188
	//_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8189
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8190
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8191
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8192
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8193
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8194
!WinWorkstation methodsFor:'initialize / release'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8195
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8196
close
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8197
    "close down the connection to the X-server"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8198
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8199
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8200
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8201
initializeDefaultValues
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8202
    focusMode := #activeWindow.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8203
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8204
    buttonTranslation := ButtonTranslation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8205
    multiClickTimeDelta := MultiClickTimeDelta.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8206
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8207
    self initializeModifierMappings
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8208
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8209
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8210
initializeEventBuffer
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8211
    |sz|
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8212
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8213
%{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8214
    sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8215
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8216
    eventBuffer isNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8217
	eventBuffer := ByteArray new:sz.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8218
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8219
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8220
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8221
initializeFor:aDisplayName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8222
    "initialize the receiver for a connection to an X-Server;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8223
     the argument, aDisplayName may be nil (for the default server from
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8224
     DISPLAY-variable or command line argument) or the name of the server
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8225
     as hostname:number"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8226
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8227
    displayId notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8228
	"/ already connected - trying to trick me ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8229
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8230
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8231
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8232
    displayId := self primInitializeFor:aDisplayName.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8233
    displayId isNil ifTrue:[^ self].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8234
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8235
    dispatching := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8236
    isSlow := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8237
    shiftDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8238
    ctrlDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8239
    metaDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8240
    altDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8241
    motionEventCompression := true.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8242
    buttonsPressed := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8243
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8244
    self initializeScreenProperties.
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8245
    self initializeDeviceResourceTables.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8246
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8247
    self initializeDefaultValues.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8248
    self initializeEventBuffer.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8249
    self initializeSpecialFlags.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8250
    self initializeKeyboardMap.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8251
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8252
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8253
initializeModifierMappings
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8254
    shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8255
    ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8256
    metaModifiers := #(#'Alt_L' #'Alt').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8257
    altModifiers := #(#'Alt_R').
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8258
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8259
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8260
initializeScreenProperties
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8261
    super initializeScreenProperties.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8262
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8263
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8264
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8265
    int scr;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8266
    int maxRGBDepth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8267
    int rgbRedMask, rgbGreenMask, rgbBlueMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8268
    int nvi, i, val, capabilities,__planes,__numcolors,__numpens,__ras;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8269
    char *type, *nm;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8270
    int dummy;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8271
    int mask, shift, nBits;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8272
    RECT rect;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8273
    HDC _rootDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8274
    OBJ id;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8275
    if (firstInstance)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8276
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8277
	OSVERSIONINFO osvi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8278
	WNDCLASS wc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8279
	firstInstance = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8280
	DPRINTF(("first create - registerClass\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8281
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8282
	memset(&osvi, 0, sizeof(OSVERSIONINFO));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8283
	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8284
	GetVersionEx (&osvi);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8285
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8286
	if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8287
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8288
	  __isWinNT = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8289
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8290
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8291
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8292
	  __isWinNT = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8293
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8294
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8295
	wc.style = /* CS_HREDRAW | CS_VREDRAW | CS_OWNDC  |*/ CS_DBLCLKS;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8296
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8297
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8298
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8299
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8300
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8301
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8302
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8303
	wc.hbrBackground = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8304
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8305
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8306
	wc.lpszClassName = app_name;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8307
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8308
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8309
	    DPRINTF(("RegisterClass failed\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8310
    /*            return NULL;     */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8311
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8312
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8313
	wc.style = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8314
	wc.lpfnWndProc = (WNDPROC) MainWndProcRoot;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8315
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8316
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8317
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8318
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8319
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8320
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8321
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8322
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8323
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8324
	wc.lpszClassName = app_nameroot;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8325
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8326
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8327
	    DPRINTF(("RegisterClass failed\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8328
    /*            return NULL;     */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8329
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8330
	hCreateEvent = CreateEvent(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8331
	    NULL,        /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8332
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8333
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8334
	    THREADEVENTNAME);  /* name of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8335
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8336
	if (hCreateEvent == NULL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8337
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8338
	    DPRINTF(("CreateEvent failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8339
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8340
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8341
	hInputEvent = CreateEvent(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8342
	    NULL,        /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8343
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8344
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8345
	    THREADINPUTEVENTNAME);  /* name of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8346
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8347
	if (hInputEvent == NULL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8348
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8349
	    DPRINTF(("InputEvent failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8350
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8351
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8352
	hdispatchMutex = CreateMutex(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8353
	    NULL,                       /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8354
	    FALSE,                      /* initially not owned */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8355
	    THREADMUTEXNAME);  /* name of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8356
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8357
	if (hdispatchMutex == NULL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8358
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8359
	    DPRINTF(("CreateMutex failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8360
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8361
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8362
	DuplicateHandle(GetCurrentProcess(),hdispatchMutex,GetCurrentProcess(),&hdispatchMutex,DUPLICATE_SAME_ACCESS,FALSE,DUPLICATE_SAME_ACCESS);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8363
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8364
	/*__setWaitInputEvent(waitInputEvent);*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8365
	bdispatchThreadState = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8366
	_masterThreadId = GetCurrentThreadId();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8367
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8368
	DuplicateHandle(GetCurrentProcess(),GetCurrentThread(),GetCurrentProcess(),&_masterThread,DUPLICATE_SAME_ACCESS,FALSE,DUPLICATE_SAME_ACCESS);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8369
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8370
        initqueue();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8371
	_beginthread(dispatchThread, 4096, 0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8372
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8373
	  DWORD dwWaitResult;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8374
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8375
	  /* Request ownership of mutex. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8376
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8377
	  dwWaitResult = WaitForSingleObject(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8378
	    hCreateEvent,   /* handle of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8379
	    5000L);   /* time-out interval */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8380
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8381
    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8382
    multiClickTime = GetDoubleClickTime();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8383
    DPRINTF(("multiClickTime = %d\n",multiClickTime));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8384
    
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8385
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8386
    __rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8387
    if (!__rootDesk)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8388
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8389
      PRINTF(("OpenDesktop fail\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8390
      __rootDesk = CreateDesktop ("Desktop0", NULL,NULL,0,DESKTOP_WRITEOBJECTS,NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8391
      if (!__rootDesk)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8392
      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8393
	PRINTF(("CreateDesktop fail\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8394
      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8395
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8396
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8397
    __rootWin = GetDesktopWindow();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8398
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8399
    id = __MKOBJ(__rootWin);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8400
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8401
    __INST(rootWin) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8402
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8403
    _rootDC = CreateDC("DISPLAY", NULL, NULL, NULL);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8404
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8405
    tmpDC = CreateCompatibleDC(_rootDC);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8406
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8407
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8408
    id = __MKOBJ(_rootDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8409
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8410
    __INST(rootDC) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8411
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8412
    GetWindowRect(__rootWin, &rect);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8413
    __INST(width) = __MKSMALLINT(rect.right-rect.left);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8414
    __INST(height) = __MKSMALLINT(rect.bottom-rect.top);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8415
    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
  8416
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8417
    __planes = GetDeviceCaps(_rootDC, PLANES);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8418
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8419
#ifndef ALWAYSTRUECOLOR
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8420
    __depth = GetDeviceCaps(_rootDC, BITSPIXEL);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8421
#else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8422
    __depth = 24;  /* its a hack */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8423
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8424
    if (__depth == 15)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8425
      __depth = 16;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8426
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8427
#if 0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8428
    __numcolors = GetDeviceCaps(_rootDC, NUMCOLORS);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8429
    __numpens = GetDeviceCaps(_rootDC, NUMPENS);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8430
    DPRINTF(("screen has %d planes\n",__planes));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8431
    DPRINTF(("numcolors is %d\n",__numcolors));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8432
    DPRINTF(("numpens is %d\n",__numpens));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8433
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8434
    __ras = GetDeviceCaps(_rootDC, RASTERCAPS);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8435
#if 0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8436
    printf("device support:\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8437
    if (__ras & RC_BANDING)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8438
      printf(" RC_BANDING");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8439
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8440
    if (__ras & RC_BITBLT)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8441
      printf(" RC_BITBLT");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8442
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8443
    if (__ras & RC_BITMAP64)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8444
      printf(" RC_BITMAP64");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8445
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8446
    if (__ras & RC_DI_BITMAP)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8447
      printf(" RC_DI_BITMAP");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8448
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8449
    if (__ras & RC_DIBTODEV)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8450
      printf(" RC_DIBTODEV");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8451
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8452
    if (__ras & RC_FLOODFILL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8453
      printf(" RC_FLOODFILL");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8454
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8455
    if (__ras & RC_PALETTE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8456
      printf(" RC_PALETTE");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8457
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8458
    if (__ras & RC_SCALING)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8459
      printf(" RC_SCALING");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8460
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8461
    if (__ras & RC_STRETCHBLT)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8462
      printf(" RC_STRETCHBLT");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8463
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8464
    if (__ras & RC_STRETCHDIB)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8465
      printf(" RC_STRETCHDIB");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8466
    printf("\n");
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8467
    printf("cursor size %d %d\n",GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8468
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8469
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8470
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8471
    __INST(depth) = __MKSMALLINT(__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8472
    __INST(ncells) = __MKSMALLINT(1<<__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8473
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8474
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8475
    val = GetDeviceCaps(_rootDC, HORZSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8476
    DPRINTF(("HORSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8477
    __INST(widthMM) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8478
    val = GetDeviceCaps(_rootDC, VERTSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8479
    DPRINTF(("VERTSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8480
    __INST(heightMM) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8481
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8482
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8483
    __logPixelSY = GetDeviceCaps(_rootDC, LOGPIXELSY);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8484
    capabilities = GetDeviceCaps(_rootDC, RASTERCAPS);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8485
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8486
    __INST(whitepixel) = __MKSMALLINT(WhitePixel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8487
    __INST(blackpixel) = __MKSMALLINT(BlackPixel);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8488
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8489
#ifndef ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8490
    if (! (capabilities & RC_PALETTE))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8491
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8492
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8493
	DPRINTF(("no palette\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8494
	if (__depth == 1) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8495
	    __INST(visualType) = @symbol(GrayScale);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8496
	    __INST(hasColors) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8497
	    __INST(hasGreyscales) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8498
	    __INST(monitorType) = @symbol(monochrome);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8499
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8500
	    __INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8501
	    __INST(hasGreyscales) = true;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8502
	    if ((__depth == 16) || (__depth == 15))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8503
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8504
	      __INST(visualType) = @symbol(TrueColor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8505
	      __INST(blueShift) = __MKSMALLINT(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8506
	      __INST(greenShift) = __MKSMALLINT(5);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8507
	      __INST(redShift) = __MKSMALLINT(11);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8508
	      __INST(bitsPerRGB) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8509
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8510
	      __INST(blueMask) = __MKSMALLINT(0x1f);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8511
	      __INST(greenMask) = __MKSMALLINT(0x7e0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8512
	      __INST(redMask) = __MKSMALLINT(0xf800);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8513
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8514
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8515
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8516
	      __INST(visualType) = @symbol(TrueColor);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8517
	      __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8518
	      __INST(greenShift) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8519
	      __INST(blueShift) = __MKSMALLINT(16);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8520
	      __INST(bitsPerRGB) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8521
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8522
	      __INST(redMask) = __MKSMALLINT(0xFF);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8523
	      __INST(greenMask) = __MKSMALLINT(0xFF00);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8524
	      __INST(blueMask) = __MKSMALLINT(0xFF0000);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8525
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8526
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8527
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8528
#ifndef ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8529
    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8530
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8531
	val = GetDeviceCaps(_rootDC, SIZEPALETTE); /* First two entries are black and white. */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8532
	printf("SizeofPalette %d\n",val);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8533
	__INST(ncells) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8534
	__INST(blackpixel) = __MKSMALLINT(0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8535
	__INST(whitepixel) = __MKSMALLINT(1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8536
	__INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8537
	__INST(hasGreyscales) = true;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8538
	__INST(usingSystemPalette) = true;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8539
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8540
	  __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8541
	  __INST(greenShift) = __MKSMALLINT(2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8542
	  __INST(blueShift) = __MKSMALLINT(4);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8543
	  __INST(bitsPerRGB) = __MKSMALLINT(2);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8544
	  __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8545
	  __INST(redMask) = __MKSMALLINT(0x3);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8546
	  __INST(greenMask) = __MKSMALLINT(0xc);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8547
	  __INST(blueMask) = __MKSMALLINT(0x30);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8548
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8549
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8550
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8551
    __INST(monitorType) = @symbol(unknown);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8552
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8553
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8554
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8555
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8556
initializeSpecialFlags
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8557
    "perform additional special server implementation flags"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8558
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8559
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8560
primInitializeFor:aDisplayName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8561
    "initialize the receiver for a connection to an X-Server;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8562
     the argument, aDisplayName may be nil (for the default server from
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8563
     DISPLAY-variable or command line argument) or the name of the server
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8564
     as hostname:number"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8565
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8566
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8567
    RETURN ( __MKSMALLINT(1) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8568
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8569
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8570
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8571
reinitialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8572
    rootWin := rootDC := nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8573
    super reinitialize.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8574
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8575
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8576
!WinWorkstation methodsFor:'keyboard mapping'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8577
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8578
altModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8579
    "return the mask (in motionEvents) for the alt-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8580
     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
  8581
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8582
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8583
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8584
    RETURN (__MKSMALLINT(AltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8585
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8586
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8587
    "Created: 23.3.1996 / 12:43:22 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8588
    "Modified: 23.3.1996 / 12:44:56 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8589
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8590
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8591
leftAltMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8592
    "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
  8593
     See comment in altModifierMask: / metaModifierMask: for what
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8594
     this could be used."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8595
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8596
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8597
    RETURN (__MKSMALLINT(LeftAltMask));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8598
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8599
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8600
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8601
metaModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8602
    "return the mask (in motionEvents) for the meta-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8603
     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
  8604
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8605
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8606
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8607
    RETURN (__MKSMALLINT(MetaMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8608
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8609
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8610
    "Created: 23.3.1996 / 12:43:39 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8611
    "Modified: 23.3.1996 / 12:45:09 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8612
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8613
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8614
modifierMapping
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8615
    "Get the Modifier Mapping.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8616
     We return an array of arrays of keycodes"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8617
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8618
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8619
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8620
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8621
rightAltMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8622
    "return the mask bit for the right Alt modifier key.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8623
     See comment in altModifierMask: / metaModifierMask: for what
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8624
     this could be used."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8625
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8626
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8627
    RETURN (__MKSMALLINT(RightAltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8628
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8629
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8630
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8631
stringFromKeycode:code
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8632
    "Get a KeySymbol (a smalltalk symbol) from the keycode."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8633
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8634
    ^ ''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8635
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8636
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8637
	Display stringFromKeycode:28
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8638
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8639
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8640
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8641
!WinWorkstation methodsFor:'misc'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8642
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8643
beep
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8644
    "output an audible beep"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8645
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8646
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8647
    Beep(__intVal(@global(BeepFrequency)), 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8648
	 __intVal(@global(BeepDuration)));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8649
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8650
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8651
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8652
flush
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8653
    "send all buffered drawing to the display.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8654
     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
  8655
     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
  8656
     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
  8657
     (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
  8658
     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
  8659
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8660
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8661
     GdiFlush();
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8662
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8663
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8664
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8665
refreshKeyboardMapping:eB
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8666
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8667
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8668
setInputFocusTo:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8669
    self setInputFocusTo:aWindowId revertTo:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8670
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8671
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8672
setInputFocusTo:aWindowId revertTo:revertSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8673
    "set the focus to the view as defined by aWindowId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8674
     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
  8675
     input until a new focus is set.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8676
     RevertSymbol specifies what should happen if the view becomes invisible;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8677
     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
  8678
     given to the parent view, the root view or no view."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8679
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8680
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8681
    if (__isExternalAddress(aWindowId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8682
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8683
	HWND hWnd = _HWNDVal(aWindowId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8684
        int r = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8685
        if (revertSymbol == @symbol(parent)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8686
        {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8687
          r = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8688
        }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8689
        else if (revertSymbol == @symbol(root)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8690
        {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8691
          r = 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8692
        }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8693
	if (hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8694
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8695
	    if (GetFocus() != hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8696
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8697
	      CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8698
	      PostMessage(hWnd,WM_THREADSETFOCUS,(INT)hWnd,GetCurrentThreadId());
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8699
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8700
	      if (SetFocus(hWnd) == 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8701
	       PRINTF(("SetFocus to %x failed.\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8702
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8703
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8704
            else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8705
            {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8706
	      CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8707
            }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8708
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8709
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8710
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8711
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8712
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8713
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8714
!WinWorkstation methodsFor:'pointer queries '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8715
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8716
anyButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8717
    "return an integer for masking out any button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8718
     buttonStates value."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8719
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8720
    "/ should use ``Display buttonXMotionMask bitOr:....''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8721
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8722
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8723
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8724
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8725
    s = __MKSMALLINT(Button1Mask|Button2Mask|Button3Mask);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8726
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8727
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8728
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8729
    "Modified: 23.3.1996 / 12:41:33 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8730
    "Created: 23.3.1996 / 12:46:35 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8731
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8732
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8733
buttonStates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8734
    "return an integer representing the state of the pointer buttons;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8735
     a one-bit in positions 0.. represent a pressed button.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8736
     See the button1Mask/button2Mask/button3Mask,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8737
     shiftMask/controlMask and modifierMask methods for the meaning of the bits."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8738
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8739
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8740
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8741
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8742
    s = __MKSMALLINT(__modifiers);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8743
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8744
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8745
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8746
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8747
     Display buttonStates
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8748
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8749
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8750
    "is the control-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8751
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8752
     Display buttonStates bitTest:(Display controlMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8753
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8754
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8755
    "is the alt/meta-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8756
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8757
     Display buttonStates bitTest:(Display altModifierMask)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8758
     Display buttonStates bitTest:(Display metaModifierMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8759
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8760
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8761
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8762
leftButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8763
    "return an integer for masking out the left button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8764
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8765
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8766
    "/ should use ``Display button1MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8767
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8768
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8769
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8770
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8771
    s = __MKSMALLINT(Button1Mask);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8772
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8773
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8774
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8775
    "Modified: 23.3.1996 / 12:41:33 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8776
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8777
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8778
middleButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8779
    "return an integer for masking out the middle button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8780
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8781
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8782
    "/ should use ``Display button2MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8783
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8784
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8785
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8786
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8787
    s = __MKSMALLINT(Button2Mask);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8788
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8789
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8790
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8791
    "Modified: 23.3.1996 / 12:41:43 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8792
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8793
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8794
pointerPosition
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8795
    "return the current pointer position in root-window coordinates"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8796
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8797
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8798
    POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8799
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8800
    if (GetCursorPos(&p)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8801
	RETURN (__MKPOINT_INT(p.x, p.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8802
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8803
    RETURN (__MKPOINT_INT(0, 0));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8804
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8805
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8806
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8807
rightButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8808
    "return an integer for masking out the right button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8809
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8810
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8811
    "/ should use ``Display button3MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8812
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8813
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8814
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8815
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8816
    s = __MKSMALLINT(Button3Mask);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8817
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8818
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8819
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8820
    "Modified: 23.3.1996 / 12:41:52 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8821
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8822
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8823
rootPositionOfLastEvent
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8824
    "return the position in root-window coordinates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8825
     of the last button, key or pointer event"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8826
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8827
    |x y|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8828
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8829
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8830
    x = __MKSMALLINT(evRootX);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8831
    y = __MKSMALLINT(evRootY);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8832
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8833
    ^ x @ y
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8834
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8835
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8836
setPointerPosition:newPosition
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8837
    "change the pointer position in root-window coordinates."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8838
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8839
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8840
    if (__isPoint(newPosition)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8841
	OBJ xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8842
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8843
	xpos = __point_X(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8844
	ypos = __point_Y(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8845
	SetCursorPos(__intVal(xpos), __intVal(ypos));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8846
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8847
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8848
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8849
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8850
setPointerPosition:newPosition in:aWindowId
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8851
    "change the pointer position to a new position relative to the
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8852
     given windows origin (which may be the rootWindow).
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8853
     Be careful with this - its usually not very ergonimically
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8854
     to change the mousePointer position.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8855
     This interface is provided for special applications (presentation
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8856
     playback) and should not be used in normal applications."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8857
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8858
    self setCursorPosition:(self translatePoint:newPosition from:aWindowId to:rootView id).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8859
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8860
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8861
!WinWorkstation methodsFor:'retrieving pixels'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8862
1461
6d8b022bfcd8 renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
  8863
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
  8864
    "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
  8865
     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
  8866
     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
  8867
     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
  8868
     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
  8869
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8870
    |rawInfo info|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8871
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8872
    ((w <= 0) or:[h <= 0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8873
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8874
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8875
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8876
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8877
    rawInfo := Array new:8.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8878
		  "1 -> bit order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8879
		  "2 -> depth"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8880
		  "3 -> bytes_per_line"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8881
		  "4 -> byte_order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8882
		  "5 -> format"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8883
		  "6 -> bitmap_unit"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8884
		  "7 -> bitmap_pad"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8885
		  "8 -> bits_per_pixel"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8886
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8887
    "/ 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
  8888
    "/ unlimitedStack (some implementations use alloca and require huge amounts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8889
    "/ of temporary stack space
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8890
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8891
    (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
  8892
	info := IdentityDictionary new.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8893
	info at:#bitOrder put:(rawInfo at:1).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8894
	info at:#depth put:(rawInfo at:2).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8895
	info at:#bytesPerLine put:(rawInfo at:3).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8896
	info at:#byteOrder put:(rawInfo at:4).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8897
	info at:#format put:(rawInfo at:5).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8898
	info at:#bitmapUnit put:(rawInfo at:6).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8899
	info at:#bitmapPad put:(rawInfo at:7).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8900
	info at:#bitsPerPixel put:(rawInfo at:8).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8901
	^ info
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8902
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8903
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8904
     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
  8905
     or is too small to hold the bits
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8906
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8907
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8908
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8909
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8910
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
  8911
    "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
  8912
     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
  8913
     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
  8914
     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
  8915
     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
  8916
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8917
    |rawInfo info|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8918
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8919
    ((w <= 0) or:[h <= 0]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8920
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8921
	^ nil
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8922
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8923
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8924
    rawInfo := Array new:8.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8925
		  "1 -> bit order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8926
		  "2 -> depth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8927
		  "3 -> bytes_per_line"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8928
		  "4 -> byte_order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8929
		  "5 -> format"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8930
		  "6 -> bitmap_unit"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8931
		  "7 -> bitmap_pad"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8932
		  "8 -> bits_per_pixel"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8933
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8934
    "/ 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
  8935
    "/ 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
  8936
    "/ of temporary stack space
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8937
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8938
    (self primGetBitsFromPixmap:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:rawInfo) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8939
	info := IdentityDictionary new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8940
	info at:#bitOrder put:(rawInfo at:1).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8941
	info at:#depth put:(rawInfo at:2).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8942
	info at:#bytesPerLine put:(rawInfo at:3).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8943
	info at:#byteOrder put:(rawInfo at:4).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8944
	info at:#format put:(rawInfo at:5).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8945
	info at:#bitmapUnit put:(rawInfo at:6).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8946
	info at:#bitmapPad put:(rawInfo at:7).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8947
	info at:#bitsPerPixel put:(rawInfo at:8).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8948
	^ info
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8949
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8950
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8951
     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
  8952
     or is too small to hold the bits
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8953
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8954
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8955
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8956
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8957
getPixelX:x y:y from:aDrawableId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8958
    "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
  8959
     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
  8960
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8961
    'getPixelX:y:from: not yet implemented' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8962
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8963
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8964
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8965
primGetBitsFrom:aDrawableId x:srcX y:srcY width:w height:h into:imageBits infoInto:info
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8966
    "since XGetImage may allocate huge amount of stack space
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8967
     (some implementations use alloca), this must run with unlimited stack."
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8968
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8969
    "'primGetBitsFrom:x:y:width:height:into:infoInto: not yet implemented' printCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8970
    ^ false"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8971
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8972
    int            height, width;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8973
    int            numBytes;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8974
    HWND        hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8975
    HBITMAP hBitmap = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8976
    HDC bDC = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8977
    struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8978
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8979
      BITMAPINFOHEADER bmiHeader;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8980
      DWORD r;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8981
      DWORD g;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8982
      DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8983
    } bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8984
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8985
    if (__isExternalAddress(aDrawableId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8986
     && __bothSmallInteger(srcX, srcY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8987
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8988
     && __isArray(info)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8989
     && __isByteArray(imageBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8990
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8991
	hWnd = _HWNDVal( aDrawableId );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8992
	DPRINTF(("primGetBits %x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8993
	if( hWnd != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8994
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8995
	    HDC wDC = GetDC(hWnd);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8996
	    bDC = CreateCompatibleDC(__rootDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8997
	    DPRINTF(("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
  8998
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8999
	    width  =  __intVal(w);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9000
	    DPRINTF(("width %d height %d\n",width,height));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9001
	    hBitmap = CreateCompatibleBitmap(__rootDC,width,height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9002
	    if (!hBitmap)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9003
	      goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9004
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9005
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9006
	    bitmap.bmiHeader.biPlanes = 1;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9007
	    if (__depth == 24)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9008
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9009
	      bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9010
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9011
	    else if (__depth == 16)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9012
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9013
	      /*bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9014
	      bitmap.bmiHeader.biCompression = BI_BITFIELDS;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9015
	      bitmap.b = 0x001f;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9016
	      bitmap.g = 0x07e0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9017
	      bitmap.r = 0xf800;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9018
	      bitmap.b = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9019
	      bitmap.g = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9020
	      bitmap.r = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9021
	      bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9022
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9023
	    bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9024
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9025
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9026
	    bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9027
	    bitmap.bmiHeader.biClrImportant = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9028
	    bitmap.bmiHeader.biBitCount = __depth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9029
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9030
	    bitmap.bmiHeader.biWidth = width;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9031
	    bitmap.bmiHeader.biHeight = -height;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9032
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9033
	    SelectObject(bDC,hBitmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9034
	    if (BitBlt(bDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9035
		   0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9036
		   width,height,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9037
		   wDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9038
		   __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9039
		   SRCCOPY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9040
		 == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9041
		)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9042
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9043
	       printf("ERROR in GetBitsFrom: BitBlt\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9044
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9045
	    ReleaseDC(hWnd,wDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9046
	    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
  9047
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9048
		printf("noinfo returned\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9049
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9050
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9051
	    DPRINTF(("bitmap info:%d %d %d %d\n",bitmap.bmiHeader.biWidth,bitmap.bmiHeader.biHeight,bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biSizeImage));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9052
	    numBytes = bitmap.bmiHeader.biSizeImage;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9053
	    if( numBytes != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9054
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9055
	      if (numBytes > __byteArraySize(imageBits)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9056
		  /* imageBits too small */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9057
		  printf("provided byteArray too small\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9058
		  goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9059
	      }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9060
	      DPRINTF(("numBytes %d\n",numBytes));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9061
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9062
	      bitmap.bmiHeader.biHeight = -height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9063
	      if (GetDIBits(bDC,hBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9064
	      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9065
		  printf("zero bits returned\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9066
		  goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9067
	      }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9068
	      else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9069
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9070
		char *c = __ByteArrayInstPtr(imageBits)->ba_element;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9071
		int n = numBytes;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9072
		for (;n > 0;n -= 3,c += 3)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9073
		{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9074
		  char b = c[0];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9075
		  c[0] = c[2];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9076
		  c[2] = b;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9077
		}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9078
	      }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9079
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9080
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9081
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9082
		printf("unacceptable bitmap\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9083
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9084
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9085
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9086
	else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9087
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9088
	    printf("unacceptable bitmap\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9089
	    goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9090
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9091
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9092
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9093
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9094
	__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(numBytes/height); //__MKSMALLINT((width * 3 + 3 )/ 4 * 4);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9095
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9096
	__ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9097
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9098
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9099
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9100
	if (bDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9101
	  DeleteDC(bDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9102
	if (hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9103
	  DelObject(hBitmap);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9104
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9105
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9106
fail:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9107
    if (bDC)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9108
      DeleteDC(bDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9109
    if (hBitmap)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9110
      DelObject(hBitmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9111
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9112
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9113
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9114
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9115
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9116
primGetBitsFromPixmap:aDrawableId x:srcX y:srcY width:w height:h into:imageBits infoInto:info
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9117
    "since XGetImage may allocate huge amount of stack space
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9118
     (some implementations use alloca), this must run with unlimited stack."
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9119
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9120
%{  /* xxLIMITEDSTACK */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9121
    int            height, width;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9122
    int            numBytes;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9123
    unsigned char* ep = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9124
    HBITMAP        xBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9125
    HBITMAP hBitmap = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9126
    HDC bDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9127
    HDC xDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9128
    struct
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9129
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9130
      BITMAPINFOHEADER bmiHeader;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9131
      DWORD rgb[2];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9132
    } bitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9133
    BITMAP bitmapInfo;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9134
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9135
    if (__isExternalAddress(aDrawableId)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9136
     && __bothSmallInteger(srcX, srcY)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9137
     && __bothSmallInteger(w, h)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9138
     && __isArray(info)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9139
     && __isByteArray(imageBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9140
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9141
	xBitmap = _HBITMAPVAL( aDrawableId );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9142
	DPRINTF(("primGetBitsFromPixmap %x\n",xBitmap));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9143
	if( xBitmap != 0 )
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9144
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9145
	    xDC = GetDC(0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9146
	    SelectObject(xDC,xBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9147
	    GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9148
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9149
	    bDC = CreateCompatibleDC(__rootDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9150
	    DPRINTF(("srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h)));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9151
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9152
	    width  =  __intVal(w);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9153
	    DPRINTF(("width %d height %d\n",width,height));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9154
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9155
	    hBitmap = CreateCompatibleBitmap(xDC,width,height);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9156
	    if (!hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9157
	      goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9158
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9159
	    SelectObject(bDC,hBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9160
	    if (BitBlt(bDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9161
		   0,0,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9162
		   width,height,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9163
		   xDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9164
		   __intVal(srcX), __intVal(srcY),
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9165
		   SRCCOPY)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9166
		 == 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9167
		)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9168
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9169
	       DPRINTF(("ERROR in primGetBitsFromPixmap: BitBlt\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9170
	       goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9171
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9172
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9173
	    bitmap.bmiHeader.biPlanes = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9174
	    if (__depth == 24)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9175
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9176
	      /*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9177
	      bitmap.r = 0xff0000;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9178
	      bitmap.g = 0x00ff00;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9179
	      bitmap.b = 0x0000ff;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9180
	      bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9181
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9182
	    else if (__depth == 16)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9183
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9184
	      /*bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9185
	      bitmap.bmiHeader.biCompression = BI_BITFIELDS;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9186
	      bitmap.b = 0x001f;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9187
	      bitmap.g = 0x07e0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9188
	      bitmap.r = 0xf800;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9189
	      bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9190
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9191
	    bitmap.bmiHeader.biSizeImage = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9192
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9193
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9194
	    bitmap.bmiHeader.biClrUsed = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9195
	    bitmap.bmiHeader.biClrImportant = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9196
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9197
	    bitmap.bmiHeader.biWidth = width;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9198
	    bitmap.bmiHeader.biHeight = -height;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9199
	    bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9200
	    if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9201
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9202
		DPRINTF(("noinfo returned\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9203
		goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9204
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9205
	    DPRINTF(("bitmap info:%d %d %d %d\n",bitmap.bmiHeader.biWidth,bitmap.bmiHeader.biHeight,bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biSizeImage));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9206
	    numBytes = bitmap.bmiHeader.biSizeImage;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9207
	    if( numBytes != 0 )
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9208
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9209
	      if (numBytes > __byteArraySize(imageBits)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9210
		  /* imageBits too small */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9211
		  DPRINTF(("provided byteArray too small\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9212
		  goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9213
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9214
	      DPRINTF(("numBytes %d\n",numBytes));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9215
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9216
	      bitmap.bmiHeader.biHeight = -height;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9217
	      bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9218
	      bitmap.rgb[0] = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9219
	      bitmap.rgb[1] = 0xffffff;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9220
	      if (GetDIBits(xDC,xBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9221
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9222
		DPRINTF(("zero bits returned\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9223
		goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9224
	      }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9225
	    }
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9226
	    else
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9227
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9228
		DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9229
		goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9230
	    }
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9231
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9232
	else
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9233
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9234
	    DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9235
	    goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9236
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9237
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9238
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9239
	__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(numBytes/height);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9240
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9241
	__ArrayInstPtr(info)->a_element[4] = (bitmap.bmiHeader.biBitCount == 1) ? @symbol(ZPixmap) : @symbol(XYPixmap);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9242
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9243
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9244
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9245
	if (bDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9246
	  DeleteDC(bDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9247
	if (xDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9248
	  ReleaseDC(0,xDC);//DeleteDC(xDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9249
	if (hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9250
	  DelObject(hBitmap);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9251
	RETURN ( true );
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9252
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9253
fail:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9254
    if (bDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9255
      DeleteDC(bDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9256
    if (xDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9257
      ReleaseDC(0,xDC);//DeleteDC(xDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9258
    if (hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9259
      DelObject(hBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9260
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9261
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9262
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9263
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9264
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9265
!WinWorkstation methodsFor:'selections'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9266
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9267
getSelectionFor:drawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9268
    'getSelectionFor: not yet implemented' errorPrintCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9269
    ^ nil
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9270
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9271
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9272
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9273
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9274
!WinWorkstation methodsFor:'style defaults'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9275
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9276
defaultStyleValueFor:aKey
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9277
    "return a default style value, given a key.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9278
     These defaults are used if nothing is specified
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9279
     in the style sheet
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9280
     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
  9281
     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
  9282
     where the systemDefaults are used ..."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9283
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9284
    <resource: #style (#viewSpacing
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9285
		       #borderColor #borderWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9286
		       #viewBackground #shadowColor #lightColor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9287
		      )>
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9288
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9289
    |clr|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9290
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9291
"/    aKey == #shadowColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9292
"/        ^ Color black
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9293
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9294
"/    aKey == #lightColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9295
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9296
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9297
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9298
    aKey == #viewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9299
	clr := self getSystemColor:#COLOR_WINDOW.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9300
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9301
    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9302
	clr := self getSystemColor:#COLOR_WINDOWTEXT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9303
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9304
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9305
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9306
"/    aKey == #scrollerViewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9307
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9308
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9309
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9310
"/    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9311
"/        ^ Color black.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9312
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9313
"/    aKey == #textBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9314
"/        ^ Color white.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9315
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9316
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9317
    clr notNil ifTrue:[^ clr].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9318
    ^ super defaultStyleValueFor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9319
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9320
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9321
!WinWorkstation methodsFor:'window stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9322
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9323
clearRectangleX:x y:y width:width height:height in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9324
    "clear a rectangular area to viewbackground"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9325
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9326
    DPRINTF(("clearRect\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9327
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9328
    super clearRectangleX:x y:y width:width height:height in:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9329
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9330
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9331
clearWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9332
    "clear a window to viewbackground"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9333
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
    DPRINTF(("clearWin\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9336
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9337
    super clearWindow:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9338
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9339
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9340
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9341
    "configure stacking operation of aWindowId w.r.t siblingId"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9342
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9343
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9344
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9345
lowerWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9346
    "bring a window to back"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9347
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9348
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9349
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9350
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9351
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9352
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9353
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9354
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9355
            CPRINTF(("lowerWindow %x\n",win));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9356
	    SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9357
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9358
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9359
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9360
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9361
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9362
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9363
mapView:aView id:aWindowId iconified:aBoolean atX:x y:y width:w height:h minExtent:minExt maxExtent:maxExt
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9364
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9365
    "make a window visible - either as icon or as a real view - needed for restart"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9366
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9367
    "/ 'mapView:id:iconified:...height: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9368
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9369
    RECT rec;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9370
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9371
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9372
     && __bothSmallInteger(w, h)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9373
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9374
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9375
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9376
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9377
	    rec.left = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9378
	    rec.top = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9379
	    rec.right = rec.left + __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9380
	    rec.bottom = rec.top + __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9381
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9382
	    AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9383
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9384
	    CPRINTF(("mapView %x x:%d y:%d w:%d h:%d -> x:%d y:%d w:%d h:%d\n",win,__intVal(x),__intVal(y),__intVal(w),__intVal(h),rec.left,rec.top,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9385
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9386
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9387
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9388
			 rec.right - rec.left, rec.bottom - rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9389
			 SWP_NOACTIVATE | SWP_NOZORDER);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9390
	    if (aBoolean == true)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9391
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9392
	      ShowWindow(win, SW_SHOWMINIMIZED);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9393
	      enqEvent(0,win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9394
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9395
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9396
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9397
	      enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9398
	      ShowWindow(win, SW_RESTORE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9399
	      /*ShowWindow(win, SW_SHOW);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9400
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9401
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9402
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9403
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9404
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9405
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9406
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9407
mapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9408
    "make a window visible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9409
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9410
%{  /* xxLIMITEDSTACK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9411
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9412
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9413
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9414
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9415
	if (win) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9416
            CPRINTF(("mapWindow %x\n",win));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9417
	    ShowWindow(win, SW_SHOWNOACTIVATE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9418
	    //ShowWindow(win, SW_SHOW);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9419
            //SetWindowPos(_thread_newWinHandle, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW|/*SWP_NOACTIVATE|*/SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9420
	    //enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9421
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9422
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9423
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9424
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9425
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9426
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9427
moveResizeWindow:aWindowId x:x y:y width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9428
    "move and resize a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9429
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9430
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9431
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9432
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9433
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9434
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9435
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9436
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9437
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9438
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9439
	    rec.left = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9440
	    rec.top = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9441
	    rec.right = rec.left + __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9442
	    rec.bottom = rec.top + __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9443
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9444
	    AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9445
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9446
	    CPRINTF(("moveresize %x x:%d y:%d w:%d h:%d -> x:%d y:%d w:%d h:%d\n",win,__intVal(x),__intVal(y),__intVal(w),__intVal(h),rec.left,rec.top,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9447
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9448
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9449
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9450
			 rec.right - rec.left, rec.bottom - rec.top,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9451
			 SWP_NOACTIVATE | SWP_NOZORDER);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9452
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9453
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9454
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9455
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9456
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9457
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9458
moveWindow:aWindowId x:x y:y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9459
    "move a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9460
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9461
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9462
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9463
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9464
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9465
     && __bothSmallInteger(x, y)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9466
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9467
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9468
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9469
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9470
	    rec.left = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9471
	    rec.top = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9472
	    rec.right = rec.left + 10;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9473
	    rec.bottom = rec.top + 10;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9474
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9475
	    AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9476
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9477
	    CPRINTF(("move %x x:%d y:%d -> x:%d y:%d\n",win,__intVal(x),__intVal(y),rec.left,rec.top));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9478
	    SetWindowPos(win, (HWND)0,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9479
			 rec.left, rec.top,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9480
			 0, 0,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9481
			 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9482
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9483
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9484
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9485
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9486
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9487
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9488
primSetWindowIconId:wiconId width:wiconWidth height:wiconHeight in:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9489
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9490
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9491
    unsigned char* cp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9492
    unsigned char* ep;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9493
    HBITMAP        xBitMap, maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9494
    ICONINFO       iconInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9495
    int            height, width;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9496
    int            nBytes, nBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9497
    int            index;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9498
    HICON          xIcon = (HICON)0, yIcon = (HICON)0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9499
    unsigned char *allocatedBits = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9500
    unsigned char fastBits[10000];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9501
    DPRINTF(("primSetWindowIconId\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9502
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9503
     && __isExternalAddress(wiconId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9504
     && __bothSmallInteger(wiconWidth, wiconHeight))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9505
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9506
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9507
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9508
	xBitMap = _HBITMAPVAL( wiconId );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9509
	if( xBitMap != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9510
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9511
	  BITMAP bm;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9512
	  if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9513
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9514
	    int d = bm.bmPlanes * bm.bmBitsPixel;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9515
	    BYTE *ep,*bp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9516
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9517
	    DPRINTF(("Bitmap w:%d h:%d p:%d d:%d\n",bm.bmWidth,bm.bmHeight,bm.bmPlanes,bm.bmBitsPixel));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9518
	    height = __intVal( wiconHeight );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9519
	    width  = __intVal( wiconWidth  );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9520
	    nBytes = ( width + 31 ) / 8;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9521
	    nBytes = height * nBytes;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9522
	    if (nBytes < sizeof(fastBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9523
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9524
		ep = fastBits;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9525
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9526
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9527
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9528
		ep = allocatedBits = (unsigned char *) malloc(nBytes);
2236
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
  9529
                CPRINTF(("malloc for windowIcon\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9530
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9531
	    if( ep != 0 ) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9532
		memset(ep,0,nBytes);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9533
		maskBitmap = CreateBitmap(width, height, 1, 1, ep );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9534
		if( maskBitmap != NULL ) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9535
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9536
		    iconInfo.fIcon = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9537
		    iconInfo.hbmMask  =maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9538
		    iconInfo.hbmColor = xBitMap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9539
		    xIcon = CreateIconIndirect( &iconInfo );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9540
		    DPRINTF(( "ICON CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9541
		    DelObject( maskBitmap );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9542
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9543
		    DPRINTF(( "BITMAP mask CREATION failed!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9544
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9545
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9546
		PRINTF(( " malloc failed\n" ));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9547
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9548
            if (allocatedBits)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9549
		free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9550
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9551
	} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9552
	    DPRINTF((" xBitMap is zero \n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9553
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9554
	if (xIcon) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9555
	   yIcon = (HICON)GetClassLong(win,GCL_HICON);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9556
	   SetClassLong(win,GCL_HICON,(DWORD)xIcon);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9557
/* It has to be checked whether thia can be deleted!!!!! */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9558
	    if( yIcon ) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9559
		if( DestroyIcon( yIcon ) )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9560
		    DPRINTF(( "Old icon deleted\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9561
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9562
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9563
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9564
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9565
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9566
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9567
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9568
raiseWindow:aWindowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9569
    "bring a window to front"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9570
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9571
%{  /* xxLIMITEDSTACK (WIN95 only) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9572
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9573
    if (__isExternalAddress(aWindowId)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9574
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9575
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9576
	if (hWnd) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9577
            CPRINTF(("raiseWindow %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9578
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9579
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9580
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9581
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9582
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9583
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9584
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9585
resizeWindow:aWindowId width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9586
    "resize a window"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9587
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9588
%{  /* xxLIMITEDSTACK (WIN95 only) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9589
    RECT rec;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9590
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9591
     && __bothSmallInteger(w, h)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9592
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9593
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9594
	if (hWnd)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9595
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9596
	    rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9597
	    rec.top = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9598
	    rec.right = __intVal(w);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9599
	    rec.bottom = __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9600
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9601
	    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
  9602
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9603
	    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
  9604
	    SetWindowPos(hWnd, (HWND)0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9605
			 0, 0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9606
			 rec.right - rec.left, rec.bottom - rec.top,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9607
			 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9608
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9609
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9610
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9611
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9612
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9613
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9614
setBackingStore:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9615
    "turn on/off backing-store for a window"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9616
    'setBackingStore:in: not yet implemented' errorPrintCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9617
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9618
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9619
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9620
setBitGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9621
    "set bit gravity for a window"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9622
    "/ 'setBitGravity:in: not yet implemented' errorPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9623
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9624
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9625
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9626
setCursor:aCursorId in:aWindowId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9627
    "define a windows cursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9628
     Ignored here, since in windows, an application
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9629
     has to manage the cursor itself."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9630
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9631
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9632
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9633
    HCURSOR newCursor;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9634
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9635
    if (ISCONNECTED
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9636
     && __isExternalAddress(aWindowId)
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9637
     && __isExternalAddress(aCursorId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9638
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9639
	POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9640
2236
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
  9641
	/*printf("setCursor:%x in:%x\n",_HCURSORVal(aCursorId),win);*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9642
	SetWindow_Cursor(win, _HCURSORVal(aCursorId));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9643
#if 1
2236
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
  9644
        PostMessage(win,WM_THREADSETCAPTURE,0,(INT)_HCURSORVal(aCursorId));
c312166c6f40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
  9645
        //PostMessage(win,WM_SETCURSOR,0,HTCLIENT);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9646
#else
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9647
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9648
	 * if the pointer is currently in that window ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9649
	 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9650
	GetCursorPos(&p);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9651
	if (1/*WindowFromPoint(p) == win*/)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9652
	{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9653
	   SetCursor(_HCURSORVal(aCursorId));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9654
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9655
#endif
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9656
	RETURN ( self );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9657
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9658
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9659
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9660
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9661
setIconName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9662
    "define a windows iconname"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9663
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9664
%{  /* xxLIMITEDSTACK (WIN95 only) */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9665
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9666
    if (__isExternalAddress(aWindowId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9667
     && (__isString(aString) || __isSymbol(aString))) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9668
	HWND win = _HWNDVal(aWindowId);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9669
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9670
	SetWindowText(win, __stringVal(aString));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9671
	RETURN (self);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9672
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9673
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9674
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9675
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9676
setSaveUnder:yesOrNo in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9677
    "turn on/off save-under for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9678
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9679
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9680
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9681
setTransient:aWindowId for:aMainWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9682
    "set aWindowId to be a transient of aMainWindow"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9683
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9684
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9685
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9686
setWindowBackground:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9687
    "set the windows background color. This is the color with which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9688
     the view is filled whenever exposed. Do not confuse this with
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9689
     the background drawing color, which is used with opaque drawing."
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9690
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9691
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9692
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9693
     && (__isSmallInteger(aColorIndex))) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9694
	HWND hWnd = _HWNDVal(aWindowId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9695
	/*HBRUSH hBrush = CreateSolidBrush(st2RGB(__intVal(aColorIndex),0));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9696
	if (GetWindow_bgBrush(hWnd))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9697
	  DelObject(GetWindow_bgBrush(hWnd));*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9698
	SetWindow_bgBrush(hWnd,st2RGB(__intVal(aColorIndex),0) /*hBrush*/);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9699
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9700
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9701
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9702
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9703
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9704
setWindowBackgroundPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9705
    "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
  9706
     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
  9707
     Do not confuse this with the background drawing color, which is used
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9708
     with opaque drawing."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9709
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9710
  'setWindowBackgroundPixmap:in: not yet implemented' errorPrintCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9711
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9712
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9713
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9714
setWindowBorderColor:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9715
    "set the windows border color"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9716
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9717
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9718
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9719
setWindowBorderPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9720
    "set the windows border pattern"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9721
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9722
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9723
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9724
setWindowBorderWidth:aNumber in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9725
    "set the windows border width"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9726
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9727
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9728
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9729
setWindowClass:wClass name:wName in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9730
    "define class and name of a window.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9731
     This may be used by the window manager to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9732
     select client specific resources."
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9733
%{  /* NOCONTEXT */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9734
    DPRINTF(("setWindowClass:name:in: not yet implemented\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9735
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9736
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9739
setWindowGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9740
    "set window gravity for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9741
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9742
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9743
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9744
setWindowIcon:aForm in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9745
    "define a bitmap to be used as icon"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9746
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9747
    |wiconId wiconHeight wiconWidth|
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9748
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9749
    aForm notNil ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9750
	wiconId := aForm id.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9751
	wiconHeight := aForm height.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9752
	wiconWidth  := aForm width.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9753
	self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9754
	    primSetWindowIconId:wiconId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9755
	    width:wiconWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9756
	    height:wiconHeight
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9757
	    in:aWindowId
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9758
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9759
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9760
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9761
setWindowIcon:aForm mask:aMaskForm in:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9762
    "set a windows icon & iconMask"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9763
%{  /* NOCONTEXT */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9764
    DPRINTF(("setWindowIcon:mask:in: not yet implemented\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9765
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9766
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9767
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9768
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9769
setWindowIconWindow:aView in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9770
    "define a window to be used as icon"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9771
    'setWindowIcon:in: not yet implemented' printCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9772
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9773
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9774
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9775
setWindowName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9776
    "define a windows name"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9777
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9778
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9779
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9780
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9781
     && (__isString(aString) || __isSymbol(aString))) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9782
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9783
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9784
	SetWindowText(win, __stringVal(aString));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9785
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9786
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9787
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9788
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9789
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9790
unmapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9791
    "make a window invisible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9792
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9793
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9794
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9795
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9796
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9797
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9798
	if (win) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9799
	    ShowWindow(win, SW_HIDE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9800
            CPRINTF(("unmapWindow %x\n",win));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9801
	    //enqEvent(win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9802
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9803
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9804
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9805
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9806
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9807
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9808
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9809
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9810
version
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  9811
    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.39 1998-08-12 11:22:55 cg Exp $'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9812
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9813
WinWorkstation initialize!