WinWorkstation.st
author Claus Gittinger <cg@exept.de>
Fri, 11 Sep 1998 19:21:38 +0200
changeset 2331 71a2798c7413
parent 2329 73bb4001db25
child 2333 3f55f0f09e25
permissions -rw-r--r--
md's out-of-view pointer-leave fixes (when grabbed)
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
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
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>   */
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
    67
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    68
#ifdef __BORLANDC__
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    69
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    70
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    71
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    72
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    73
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    74
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    75
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    76
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    77
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    78
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    79
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    80
# define WIN32_LEAN_AND_MEAN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    81
# include <windows.h>
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    82
# include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    83
#else
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    84
# define _USERENTRY /**/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    85
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    86
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    87
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    88
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    89
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    90
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    91
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    92
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    93
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    94
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    95
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    96
# define WIN32_LEAN_AND_MEAN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    97
# include <windows.h>
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    98
# include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    99
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   100
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   101
#include <process.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   102
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   103
#   ifdef __DEF_Array
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   104
#    undef Array
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   105
#    define Array __DEF_Array
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   106
#   endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   107
#   ifdef __DEF_Number
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   108
#    undef Number
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   109
#    define Number __DEF_Number
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   110
#   endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   111
#   ifdef __DEF_Method
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   112
#    undef Method
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   113
#    define Method __DEF_Method
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   114
#   endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   115
#   ifdef __DEF_Point
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   116
#    undef Point
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   117
#    define Point __DEF_Point
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   118
#   endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   119
#   ifdef __DEF_Block
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   120
#    undef Block
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   121
#    define Block __DEF_Block
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   122
#   endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   123
#   ifdef __DEF_Context
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   124
#    undef Context
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   125
#    define Context __DEF_Context
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   126
#   endif
1912
f92a2ff8ffc4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   127
#   undef INT
f92a2ff8ffc4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1725
diff changeset
   128
#   define INT int
1127
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
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   131
 * some defines - tired of typing ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   132
 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   133
#define _HANDLEVal(o)        (HANDLE)(__MKCP(o))
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   134
#define _HBITMAPVAL(o)       (HBITMAP)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   135
#define _HWNDVal(o)          (HWND)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   136
#define _HPALETTEVal(o)      (HPALETTE)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   137
#define _HCURSORVal(o)       (HCURSOR)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   138
#define _HGDIOBJVal(o)       (HGDIOBJ)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   139
#define _LOGPALETTEVal(o)    (LOGPALETTE *)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   140
#define _COLORREFVal(o)      (COLORREF)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   141
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   142
#define _GCDATA(o)           ((struct gcData *)(__MKCP(o)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   143
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   144
#define __rootDC             (HDC)(__MKCP(__INST(rootDC)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   145
#define ISCONNECTED          (__INST(rootDC) != nil)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   146
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   147
struct gcData {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   148
    HWND        hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   149
    HBITMAP     hBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   150
    HBITMAP     savehBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   151
    int         clipping;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   152
    int         clipX;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   153
    int         clipY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   154
    int         clipW;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   155
    int         clipH;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   156
    int         clipByChild;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   157
    HDC         _hDC;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   158
    HBITMAP     hMask;
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   159
    int         maskOrgX;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   160
    int         maskOrgY;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   161
    int         bitmapColorBitCount;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   162
    int         lineWidth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   163
    int         lineStyle;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   164
    int         joinStyle;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   165
    int         capStyle;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   166
    int         fontAscent;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   167
    int         rop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   168
    int         bitbltrop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   169
    COLORREF    fgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   170
    COLORREF    bgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   171
    HFONT       hFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   172
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   173
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   174
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   175
 * some synthetic values
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   176
 */
2151
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
 * EVENT DEFINITIONS
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   179
 *****************************************************************/
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
/* 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
   182
   to Grab requests.  Not to be confused with event names.  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   183
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   184
#define NoEventMask                     0L
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   185
#define KeyPressMask                    (1L<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   186
#define KeyReleaseMask                  (1L<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   187
#define ButtonPressMask                 (1L<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   188
#define ButtonReleaseMask               (1L<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   189
#define EnterWindowMask                 (1L<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   190
#define LeaveWindowMask                 (1L<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   191
#define PointerMotionMask               (1L<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   192
#define PointerMotionHintMask           (1L<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   193
#define Button1MotionMask               (1L<<8)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   194
#define Button2MotionMask               (1L<<9)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   195
#define Button3MotionMask               (1L<<10)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   196
#define Button4MotionMask               (1L<<11)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   197
#define Button5MotionMask               (1L<<12)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   198
#define ButtonMotionMask                (1L<<13)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   199
#define KeymapStateMask                 (1L<<14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   200
#define ExposureMask                    (1L<<15)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   201
#define VisibilityChangeMask            (1L<<16)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   202
#define StructureNotifyMask             (1L<<17)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   203
#define ResizeRedirectMask              (1L<<18)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   204
#define SubstructureNotifyMask          (1L<<19)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   205
#define SubstructureRedirectMask        (1L<<20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   206
#define FocusChangeMask                 (1L<<21)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   207
#define PropertyChangeMask              (1L<<22)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   208
#define ColormapChangeMask              (1L<<23)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   209
#define OwnerGrabButtonMask             (1L<<24)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   210
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   211
/* 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
   212
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
   213
are reserved in the protocol for errors and replies. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   214
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   215
#define KeyPress                2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   216
#define KeyRelease              3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   217
#define ButtonPress             4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   218
#define ButtonRelease           5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   219
#define MotionNotify            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   220
#define EnterNotify             7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   221
#define LeaveNotify             8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   222
#define FocusIn                 9
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   223
#define FocusOut                10
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   224
#define KeymapNotify            11
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   225
#define Expose                  12
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   226
#define GraphicsExpose          13
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   227
#define NoExpose                14
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   228
#define VisibilityNotify        15
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   229
#define CreateNotify            16
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   230
#define DestroyNotify           17
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   231
#define UnmapNotify             18
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   232
#define MapNotify               19
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   233
#define MapRequest              20
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   234
#define ReparentNotify          21
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   235
#define ConfigureNotify         22
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   236
#define ConfigureRequest        23
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   237
#define GravityNotify           24
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   238
#define ResizeRequest           25
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   239
#define CirculateNotify         26
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   240
#define CirculateRequest        27
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   241
#define PropertyNotify          28
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   242
#define SelectionClear          29
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   243
#define SelectionRequest        30
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   244
#define SelectionNotify         31
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   245
#define ColormapNotify          32
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   246
#define ClientMessage           33
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   247
#define MappingNotify           34
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   248
#define LASTEvent               35      /* must be bigger than any event # */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   249
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   250
/*# define Button1MotionMask      1
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   251
# define Button2MotionMask      2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   252
# define Button3MotionMask      4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   253
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   254
# define Button1Mask            Button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   255
# define Button2Mask            Button2MotionMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   256
# define Button3Mask            Button3MotionMask*/
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
/* 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
   259
   state in various key-, mouse-, and button-related events. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   260
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   261
#define ShiftMask               (1<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   262
#define LockMask                (1<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   263
#define ControlMask             (1<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   264
#define Mod1Mask                (1<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   265
#define Mod2Mask                (1<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   266
#define Mod3Mask                (1<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   267
#define Mod4Mask                (1<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   268
#define Mod5Mask                (1<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   269
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   270
/* modifier names.  Used to build a SetModifierMapping request or
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   271
   to read a GetModifierMapping request.  These correspond to the
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   272
   masks defined above. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   273
#define ShiftMapIndex           0
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   274
#define LockMapIndex            1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   275
#define ControlMapIndex         2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   276
#define Mod1MapIndex            3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   277
#define Mod2MapIndex            4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   278
#define Mod3MapIndex            5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   279
#define Mod4MapIndex            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   280
#define Mod5MapIndex            7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   281
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
/* 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
   284
   with button names below. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   285
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   286
# define Button1Mask            Button1MotionMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   287
# define Button2Mask            Button2MotionMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   288
# define Button3Mask            Button3MotionMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   289
# define Button4Mask            Button4MotionMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   290
# define Button5Mask            Button5MotionMask
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
#define AnyModifier             (1<<15)  /* used in GrabButton, GrabKey */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   293
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   294
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   295
/* 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
   296
   and ButtonRelease events.  Not to be confused with button masks above.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   297
   Note that 0 is already defined above as "AnyButton".  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   298
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   299
#define Button1                 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   300
#define Button2                 2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   301
#define Button3                 3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   302
#define Button4                 4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   303
#define Button5                 5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   304
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   305
/*# define ControlMask            8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   306
# define ShiftMask              16*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   307
# define LeftAltMask            Mod1Mask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   308
# define RightAltMask           Mod2Mask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   309
# define TRANSLATED_KEY         Mod5Mask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   310
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   311
#define WIN32PADDING 32
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   312
/*
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   313
 * synthetic events
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   314
 */
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   315
#define __WM_MOUSEENTER        0x10001
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   316
#define __WM_MOUSELEAVE        0x10002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   317
#define __WM_GEXPOSE           0x10003
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   318
#define __WM_NOGEXPOSE         0x10004
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   319
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   320
static int AltMask = RightAltMask;
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   321
static int MetaMask = LeftAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   322
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   323
# define WhitePixel     RGB(0xFF, 0xFF, 0xFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   324
# define BlackPixel     RGB(0, 0, 0)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   325
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   326
/*#undef DEBUG*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   327
#ifdef DEBUG
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   328
# define PRINTF(x)              { printf x;}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   329
# define CPRINTF(x)             { if (__debug__) printf x;}
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   330
# define RESPRINTF(x)           /*{ if (__debug__) printf x;}*/
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   331
# define RES1PRINTF(x)          /*{ if (__debug__) printf x;}*/
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   332
# 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
   333
# define TH_DPRINTF(x)          /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   334
# define POSTPRINTF(x)          { if (__debug__) printf x;}
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   335
# define DPRINTF(x)             { if (__debug__) printf x;}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   336
# define DDPRINTF(x)            /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   337
# define EVENT_PRINTF(x)        /*{ if (__debug__) printf x;}*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   338
# define EVENT_PRINTF2(x)       /*{ if (__debug__) printf x;}*/
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   339
# define EVENT_PRINTF3(x)       /* */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   340
# define UNHANDLED_EVENT_PRINTF(x)  { if (__debug__) printf x;}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   341
#else
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   342
# define PRINTF(x)             /* */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   343
# define CPRINTF(x)             /* */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   344
# define RES_BMP_PRINTF(x)     /**/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   345
# define RESPRINTF(x)             /* */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   346
# define RES1PRINTF(x)             /* */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   347
# define TH_DPRINTF(x)          /* */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   348
# define POSTDPRINTF(x)          /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   349
# define DPRINTF(x)             /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   350
# define DDPRINTF(x)            /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   351
# define EVENT_PRINTF(x)        /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   352
# define EVENT_PRINTF2(x)       /* */
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   353
# define EVENT_PRINTF3(x)       /* */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   354
# define UNHANDLED_EVENT_PRINTF(x)        /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   355
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   356
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   357
# define BR_SOLID       0
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   358
# define BR_PATTERN     1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   359
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   360
# define LINE_SOLID     0
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   361
# define LINE_DASH      1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   362
# define LINE_DDASH     2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   363
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   364
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   365
# define _C_ARROW       1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   366
# define _C_CROSS       2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   367
# define _C_IBEAM       3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   368
# define _C_ICON        4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   369
# define _C_NO          5
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   370
# define _C_SIZE        6
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   371
# define _C_SIZEALL     7
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   372
# define _C_SIZENESW    8
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   373
# define _C_SIZENS      9
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   374
# define _C_SIZENWSE    10
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   375
# define _C_UPARROW     11
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   376
# define _C_WAIT        12
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   377
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   378
 static HCURSOR H_C_ARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   379
 static HCURSOR H_C_CROSS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   380
 static HCURSOR H_C_IBEAM = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   381
 static HCURSOR H_C_ICON = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   382
 static HCURSOR H_C_NO = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   383
 static HCURSOR H_C_SIZE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   384
 static HCURSOR H_C_SIZEALL = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   385
 static HCURSOR H_C_SIZENESW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   386
 static HCURSOR H_C_SIZENS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   387
 static HCURSOR H_C_SIZENWSE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   388
 static HCURSOR H_C_UPARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   389
 static HCURSOR H_C_WAIT = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   390
#endif /* KEEP_STD_CURSORS */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   391
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   392
static int c_count;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   393
static int evRootX, evRootY;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   394
static int multiClickState;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   395
static UINT lastMSGTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   396
static UINT multiClickTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   397
static UINT nextMultiClickTime;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   398
static int destroyWin;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   399
static int __modifiers;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   400
static HDC tmpDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   401
static int __isWinNT;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   402
static int __logPixelSY;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   403
static struct gcData *lastGcData;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   404
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   405
#define WM_THREADCREATEWINDOW   WM_USER + 0x101
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   406
#define WM_THREADDESTROYWINDOW  WM_USER + 0x102
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   407
#define WM_THREADSETFOCUS       WM_USER + 0x103
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   408
#define WM_THREADSETCAPTURE     WM_USER + 0x104
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
   409
#define WM_THREADSETCURSOR      WM_USER + 0x105
2000
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
#define THREADINPUTEVENTNAME "InputEvents"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   412
#define THREADEVENTNAME "CreateEvents"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   413
#define THREADMUTEXNAME "MutexToProtectEvents"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   414
#define isInputEvent() ((int)eventQueueHead)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   415
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   416
typedef int (*intf)(int);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   417
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   418
/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   419
 * 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
   420
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   421
#define LI_TOPWIN       0x0001
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   422
#define LI_INPUTWIN     0x0002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   423
typedef struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   424
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   425
	HCURSOR hCursor;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   426
	int  bgBrush;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   427
	int flag;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   428
	int minWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   429
	int maxWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   430
	int minHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   431
	int maxHeight;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   432
	int eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   433
} localWindowInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   434
typedef localWindowInfo *plocalWindowInfo;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   435
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   436
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   437
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   438
#define GETLOCALWINDOWINFOPTR(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   439
	((localWindowInfo*)GetWindowLong(__hWnd__, 0))
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   440
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   441
#define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   442
	SetWindowLong(__hWnd__, 0 , (DWORD)__ptr__)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   443
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   444
#define SetWindow_Cursor(__hWnd__, __hCurs__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   445
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   446
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   447
#define GetWindow_Cursor(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   448
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   449
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   450
#define SetWindow_bgBrush(__hWnd__, __bgBrush__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   451
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bgBrush = __bgBrush__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   452
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   453
#define GetWindow_bgBrush(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   454
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bgBrush : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   455
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   456
#define GetWindow_paintInfoPtr(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   457
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   458
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   459
#define GetWindow_sizeInfoPtr(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   460
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->sizeInfo) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   461
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   462
#define SetWindow_Flag(__hWnd__, __flag__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   463
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   464
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   465
#define GetWindow_Flag(__hWnd__) \
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   466
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   467
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   468
#define GetWindow_eventMask(__hWnd__) \
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   469
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   470
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   471
struct queuedEvent {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   472
	struct queuedEvent     *ev_next;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   473
	int                     count;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   474
	int                     ev_flag;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   475
	HWND                    ev_hWnd;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   476
	UINT                    ev_message;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   477
	UINT                    ev_wParam;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   478
	int                     ev_arg1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   479
	int                     ev_arg2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   480
	int                     ev_arg3;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   481
	int                     ev_arg4;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   482
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   483
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   484
#define ev_x    ev_arg1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   485
#define ev_y    ev_arg2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   486
#define ev_w    ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   487
#define ev_h    ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   488
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   489
#define ev_keyCode   ev_wParam
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   490
#define ev_scanCode  ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   491
#define ev_modifiers ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   492
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   493
#define EV_CHUNK_CNT    10000
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   494
#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
   495
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   496
#define BITBLT_COPY             SRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   497
#define BITBLT_COPYINVERTED     NOTSRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   498
#define BITBLT_XOR              SRCINVERT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   499
#define BITBLT_AND              SRCAND
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   500
#define BITBLT_OR               SRCPAINT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   501
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   502
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   503
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   504
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   505
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   506
!WinWorkstation primitiveVariables!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   507
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   508
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   509
static int firstInstance = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   510
static char *app_name = "ST/X";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   511
static char *app_nameroot = "ST/X:Root";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   512
static int __debug__ = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   513
static int __depth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   514
static HWND __rootWin = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   515
static HWND __rootWinSpezial = NULL;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   516
static HDESK __rootDesk;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   517
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   518
#define CAPTURE_NONE     0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   519
#define CAPTURE_EXPLICIT 1
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   520
#define CAPTURE_IMPLICIT 2
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   521
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   522
static int currentCapture = CAPTURE_NONE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   523
static int lastNCMouseX, lastNCMouseY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   524
static int lastMoveX, lastMoveY, lastSizeWidth, lastSizeHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   525
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   526
static HANDLE currentPointerView = (HANDLE)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   527
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   528
/* MessageDispatchThread */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   529
static char *_thread_windowName;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   530
static char *_thread_className;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   531
static int _thread_winStyleBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   532
static int _thread_winStyleBitsEx;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   533
static HANDLE _thread_parentHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   534
static int _thread_x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   535
static int _thread_y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   536
static int _thread_dx;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   537
static int _thread_dy;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   538
static localWindowInfo *_thread_local;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   539
static HANDLE _thread_newWinHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   540
static DWORD _masterThreadId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   541
static HANDLE _masterThread;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   542
static DWORD _dispatchThreadId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   543
static BOOL bdispatchThreadState;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   544
static int lockcount;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   545
static HANDLE hdispatchMutex;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   546
static HANDLE hCreateEvent;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   547
static HANDLE hInputEvent;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   548
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   549
static int __cnt_bmpdc;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   550
static int __cnt_gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   551
static int __cnt_createWindows;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   552
static int __cnt_bitmap;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   553
static int __cnt_cur;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   554
static int __cnt_font;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   555
struct queuedEvent *eventFreeList = (struct queuedEvent *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   556
struct queuedEvent *eventQueueHead = (struct queuedEvent *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   557
struct queuedEvent *eventQueueTail = (struct queuedEvent *)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   558
static int eventsendcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   559
static int eventempfcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   560
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   561
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   562
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   563
!WinWorkstation primitiveFunctions!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   564
%{
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   565
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   566
#ifdef xxWIN32THREADS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   567
extern void __suspendAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   568
extern void __resumeAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   569
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   570
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   571
__debugEvent__() {}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   572
#ifdef DEBUGMASK
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   573
printMask(int mask)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   574
{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   575
    if (mask & KeyPressMask)        printf("KeyPressMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   576
    if (mask & KeyReleaseMask)      printf("KeyReleaseMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   577
    if (mask & ButtonPressMask)     printf("ButtonPressMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   578
    if (mask & ButtonReleaseMask)   printf("ButtonReleaseMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   579
    if (mask & ButtonMotionMask)    printf("ButtonMotionMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   580
    if (mask & PointerMotionMask)   printf("PointerMotionMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   581
    if (mask & ExposureMask)        printf("ExposureMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   582
    if (mask & FocusChangeMask)     printf("FocusChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   583
    if (mask & EnterWindowMask)     printf("EnterWindowMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   584
    if (mask & LeaveWindowMask)     printf("LeaveWindowMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   585
    if (mask & KeymapStateMask)     printf("KeymapStateMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   586
    if (mask & VisibilityChangeMask)printf("VisibilityChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   587
    if (mask & StructureNotifyMask) printf("StructureNotifyMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   588
    if (mask & ResizeRedirectMask)  printf("ResizeRedirectMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   589
    if (mask & PropertyChangeMask)  printf("PropertyChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   590
    if (mask & ColormapChangeMask)  printf("ColormapChangeMask\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   591
}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   592
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   593
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   594
static int
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   595
st2RGB(int color,struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   596
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   597
  int ir,ig,ib;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   598
  if (gcData)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   599
  {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   600
    if (gcData->bitmapColorBitCount == 1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   601
    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   602
      if (color)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   603
	return WhitePixel;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   604
      else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   605
	return BlackPixel;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   606
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   607
  }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   608
  if (__depth < 15)
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 0;
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
  else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   613
  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   614
    if ((__depth == 16) || (__depth == 15))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   615
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   616
      ib = (color & 0x1f) << 3;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   617
      ig = ((color >> 5) & 0x3f) << 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   618
      ir = ((color >> 11) & 0x1f) << 3;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   619
      ir |= 7;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   620
      ig |= 3;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   621
      ib |= 7;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   622
      return RGB(ir,ig,ib);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   623
    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   624
    return (color & 0xffffff);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   625
  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   626
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   627
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   628
static int
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   629
RGB2st(int r,int g,int b)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   630
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   631
  int ir,ig,ib,id;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   632
  if (__depth < 15)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   633
  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   634
    id = 0;
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
  else
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
    if ((__depth == 16) || (__depth == 15))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   639
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   640
      ir = (r >> 11) & 0x1f;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   641
      ig = (g >> 10) & 0x3f;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   642
      ib = (b >> 11) & 0x1f;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   643
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   644
      id = ( ir << 11 ) | ( ig << 5 ) | ib;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   645
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   646
    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   647
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   648
      ir = (r >> 8) & 0xff;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   649
      ig = (g >> 8) & 0xff;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   650
      ib = (b >> 8) & 0xff;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   651
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   652
      id = RGB( ir, ig, ib);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   653
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   654
  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   655
  return id;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   656
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   657
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   658
static int
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   659
DelObject(HANDLE o)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   660
{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   661
    int r = DeleteObject(o);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   662
    if (r == 0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   663
      printf("ERROR in DelObjectect\n");
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   664
    return r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   665
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   666
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   667
static struct gcData *
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   668
newGcData() {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   669
    struct gcData *gcData = (struct gcData *)malloc(sizeof(struct gcData));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   670
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   671
    if (! gcData) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   672
	return 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   673
    }
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   674
    memset(gcData, 0, sizeof(struct gcData));
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   675
    gcData->fgColor = 0xffffff;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   676
    gcData->clipping = FALSE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   677
    gcData->clipByChild = TRUE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   678
    gcData->bitbltrop2 = BITBLT_COPY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   679
    gcData->lineWidth = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   680
    gcData->lineStyle = PS_SOLID;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   681
    gcData->joinStyle = PS_JOIN_MITER;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   682
    gcData->capStyle = PS_ENDCAP_FLAT;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   683
    /* gcData->brushOrgX = gcData->brushOrgY = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   684
    return gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   685
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   686
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   687
static void
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   688
__releaseDC(struct gcData *gcData)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   689
{
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   690
}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   691
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   692
static void
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   693
_releaseDC(struct gcData *gcData)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   694
{
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   695
    if (gcData->hWnd) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   696
	if (gcData->_hDC) {
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   697
	    ReleaseDC(gcData->hWnd,gcData->_hDC);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   698
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   699
    } else if (gcData->hBitmap) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   700
	SelectObject(gcData->_hDC,gcData->savehBitmap);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   701
	DeleteDC(gcData->_hDC);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   702
    }
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   703
    gcData->_hDC = 0;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   704
}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   705
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   706
static HDC
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   707
_getDC(struct gcData *gcData)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   708
{
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   709
#if 0
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   710
    if (lastGcData) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   711
	if (lastGcData == gcData) {
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   712
	    //printf(".");
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   713
	    return gcData->_hDC;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   714
	}
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   715
	__releaseDC(lastGcData);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   716
    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   717
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   718
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   719
    if (gcData->hWnd != 0) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   720
	if (__isWinNT && (gcData->hWnd == __rootWin)) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   721
	    gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_WINDOW);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   722
	    //gcData->_hDC = GetDC(gcData->hWnd);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   723
	} else {
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   724
	    if (gcData->clipByChild) {
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   725
		//gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_CLIPCHILDREN);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   726
		gcData->_hDC = GetDC(gcData->hWnd);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   727
	    } else
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   728
		gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_PARENTCLIP);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   729
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   730
    } else if (gcData->hBitmap) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   731
	gcData->_hDC = CreateCompatibleDC(tmpDC);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   732
	gcData->savehBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   733
    }
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   734
    if (gcData->_hDC) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   735
	SetTextColor(gcData->_hDC, gcData->bgColor);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   736
	SetBkColor(gcData->_hDC, gcData->fgColor);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   737
	if (gcData->rop2)
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   738
	    SetROP2(gcData->_hDC, gcData->rop2);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   739
	if (gcData->clipping) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   740
	    HRGN  region = CreateRectRgn( gcData->clipX,gcData->clipY,
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   741
					  gcData->clipX + gcData->clipW,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   742
					  gcData->clipY + gcData->clipH );
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   743
	    if( region == NULL ) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   744
		DPRINTF((" clipping region creation failed!\n"));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   745
	    } else {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   746
		if (SelectClipRgn(gcData->_hDC, region) == ERROR ) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   747
		    DPRINTF((" clipping region release unsuccessful\n" ));
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   748
		}
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   749
		/*printf("%x c\n",hDC);*/
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   750
		DelObject(region);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   751
	    }
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   752
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   753
    }
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   754
    lastGcData = gcData;
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   755
    return gcData->_hDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   756
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   757
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   758
static HBRUSH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   759
GcDataGetBrush(HDC hDC,struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   760
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   761
    HBRUSH hBrush = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   762
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   763
    if (gcData->hMask) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   764
	hBrush = CreatePatternBrush(gcData->hMask);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   765
	RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   766
    } else {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   767
	hBrush = CreateSolidBrush(gcData->fgColor);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   768
	RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   769
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   770
    return hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   771
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   772
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   773
static HPEN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   774
GcDataGetPen(HDC hDC,struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   775
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   776
    HPEN hPen = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   777
    LOGBRUSH Brush;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   778
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   779
    if (gcData->hMask) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   780
	Brush.lbStyle = BS_PATTERN;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   781
	Brush.lbHatch = (DWORD)gcData->hMask;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   782
	Brush.lbColor = gcData->fgColor;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   783
	hPen = ExtCreatePen(PS_GEOMETRIC | gcData->capStyle | gcData->joinStyle | gcData->lineStyle,
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   784
			    gcData->lineWidth,
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   785
			    &Brush,
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   786
			    0,0);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   787
	SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);       
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   788
	RESPRINTF(("ExtCreatePen %s %d %x %x\n",(gcData->lineStyle == PS_SOLID) ? "SOLID " : "DASHED",
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   789
						gcData->lineWidth,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   790
						gcData->fgColor,gcData->hMask));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   791
    }
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   792
    if (! hPen) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   793
	if (gcData->lineStyle == PS_SOLID)
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   794
	    hPen = CreatePen(gcData->lineStyle,
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   795
			     gcData->lineWidth,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   796
			     gcData->fgColor);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   797
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   798
	    hPen = CreatePen(PS_DOT,
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   799
			     0,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   800
			     0);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   801
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   802
	RESPRINTF(("CreatePen %s %d %x\n",(gcData->lineStyle == PS_SOLID) ? "SOLID " : "DASHED",
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   803
					  gcData->lineWidth,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
   804
					  gcData->fgColor));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   805
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   806
    return hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   807
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   808
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   809
static int
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   810
lockEvent()
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   811
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   812
    DWORD dwWaitResult;
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
    /* Request ownership of mutex. */
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
    dwWaitResult = WaitForSingleObject(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   817
	hdispatchMutex,   /* handle of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   818
	5000L);   /* time-out interval */
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
    lockcount++;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   821
    if (lockcount != 1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   822
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   823
       printf("WINWORKSTATION:lockcount != 1 :=%d\n",lockcount);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   824
       lockcount = 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   825
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   826
    switch (dwWaitResult)
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
	// The thread got mutex ownership.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   829
	case WAIT_OBJECT_0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   830
	    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   831
	// Cannot get mutex ownership due to time-out.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   832
	case WAIT_TIMEOUT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   833
	    printf("lockEvent fail\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   834
	    return FALSE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   835
	// Got ownership of the abandoned mutex object.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   836
	default:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   837
	    return FALSE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   838
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   839
    return TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   840
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   841
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   842
static void
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   843
unlockEvent()
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   844
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   845
    if (lockcount != 1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   846
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   847
       printf("lockcount != 1 :=%d\n",lockcount);
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
    lockcount--;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   850
    /* Release ownership of the mutex object. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   851
    if (! ReleaseMutex(hdispatchMutex)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   852
      /* Deal with error. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   853
      printf("unlock Error\n");
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
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   856
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   857
static int
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   858
initqueue()
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   859
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   860
    struct queuedEvent *bulk;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   861
    int i = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   862
    bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   863
    if (bulk == 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   864
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   865
      printf("no memory for dispatchqueue\n");
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   866
      return 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   867
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   868
    for (i=1; i<EV_CHUNK_CNT; i++) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   869
	bulk[i-1].ev_next = &(bulk[i]);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   870
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   871
    bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   872
    eventFreeList = bulk;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   873
    return 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   874
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   875
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   876
static void
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   877
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
   878
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   879
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   880
    int repeatCount = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   881
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   882
    TH_DPRINTF(("TEW\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   883
    if (lockEvent())
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   884
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   885
      TH_DPRINTF(("TEF\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   886
again:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   887
      ev = eventFreeList;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   888
      if (ev) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   889
	  eventFreeList = ev->ev_next;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   890
	  ev->ev_next = (struct queuedEvent *)0;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   891
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   892
	  ev->count = eventsendcount++;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   893
	  ev->ev_flag = flag;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   894
	  ev->ev_hWnd = hWnd;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   895
	  ev->ev_message = message;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   896
	  ev->ev_wParam = wParam;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   897
	  ev->ev_arg1 = arg1;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   898
	  ev->ev_arg2 = arg2;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   899
	  ev->ev_arg3 = arg3;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   900
	  ev->ev_arg4 = arg4;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   901
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   902
	  if (eventQueueTail) {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   903
	      eventQueueTail->ev_next = ev;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   904
	  } else {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   905
	      eventQueueHead = ev;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   906
	  }
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   907
	  eventQueueTail = ev;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   908
      } else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   909
	unlockEvent();
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   910
	SetEvent(hInputEvent);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
   911
	printf("winthread wait\n");
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   912
	if (repeatCount++ < 10)
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   913
	{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   914
	  Sleep(20);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   915
	  if (lockEvent())
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   916
	  {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   917
	     goto again;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   918
	  }
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   919
	}
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
   920
	printf("winthread throw away\n");
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   921
	/* throw away sorry */
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
   922
	return;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   923
      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   924
      unlockEvent();
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   925
      SetEvent(hInputEvent);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   926
      /*SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);*/
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
   927
      //Sleep(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   928
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   929
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   930
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   931
static
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   932
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
   933
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   934
  struct queuedEvent *ev = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   935
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   936
  if (mask != ~0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   937
  {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
   938
    PRINTF(("deqEvent mask:%x\n",mask));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   939
  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   940
  if (hWnd)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   941
  {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
   942
    PRINTF(("deqEvent hWnd:%x\n",hWnd));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   943
  }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   944
  if (lockEvent())
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   945
  {
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
    while (TRUE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   948
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   949
      TH_DPRINTF(("TDEQ\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   950
      ev = eventQueueHead;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   951
      if (ev)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   952
      {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   953
	eventQueueHead = ev->ev_next;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   954
	if (! eventQueueHead)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   955
	{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   956
	    eventQueueTail = (struct queuedEvent *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   957
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   958
	if (eventempfcount != ev->count)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   959
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   960
	  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
   961
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   962
	eventempfcount++;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   963
	if (ev->ev_message == WM_DESTROY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   964
	{
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
   965
	    if (ev->ev_arg2)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
   966
	    {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
   967
	      free((char*)ev->ev_arg2);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
   968
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
   969
#ifdef TOPWINDOWCLASS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   970
	    if (ev->ev_arg1)
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
	      if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance()))
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
		/*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
   975
		free((char*)ev->ev_arg1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   976
		ev->ev_arg1 = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   977
	      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   978
	      else
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
		/* noch einmal in die queue */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   981
		if (ev->ev_arg2++ < 100)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   982
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   983
		  ev->ev_next = (struct queuedEvent *)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   984
		  ev->count = eventsendcount++;
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
		  if (eventQueueTail) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   987
		      eventQueueTail->ev_next = ev;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   988
		  } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   989
		      eventQueueHead = ev;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   990
		  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   991
		  eventQueueTail = ev;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   992
		  if (ev->ev_arg2 > 98)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   993
		  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   994
		    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
   995
		    unlockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   996
		    sleep(1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   997
		    lockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   998
		  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   999
		  else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1000
		  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1001
		    unlockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1002
		    sleep(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1003
		    lockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1004
		  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1005
		  continue;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1006
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1007
		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
  1008
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1009
		  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
  1010
		  free((char*)ev->ev_arg1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1011
		  ev->ev_arg1 = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1012
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1013
	      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1014
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1015
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1016
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1017
	break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1018
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1019
      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1020
      else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1021
	break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1022
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1023
    if (ev)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1024
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1025
      *ret_ev = *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1026
      ev->ev_next = eventFreeList;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1027
      eventFreeList = ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1028
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1029
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1030
    unlockEvent();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1031
  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1032
    /*if (!ev)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1033
      SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_NORMAL);*/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1034
  return (ev != 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1035
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1036
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1037
static
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1038
getModifiers()
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1039
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1040
    int modifiers = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1041
    if (GetKeyState(VK_SHIFT) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1042
	modifiers |= ShiftMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1043
    if (GetKeyState(VK_CONTROL) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1044
	modifiers |= ControlMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1045
#if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1046
    if (GetKeyState(VK_RMENU) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1047
	modifiers |= RightAltMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1048
    if (GetKeyState(VK_LMENU) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1049
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1050
#else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1051
    if (GetKeyState(VK_MENU) & 0x8000)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1052
	modifiers |= LeftAltMask;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1053
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1054
    if (GetKeyState(VK_LBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1055
	modifiers |= Button1Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1056
    if (GetKeyState(VK_MBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1057
	modifiers |= Button2Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1058
    if (GetKeyState(VK_RBUTTON) & 0x8000)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1059
	modifiers |= Button3Mask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1060
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1061
    __modifiers = modifiers;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1062
    return modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1063
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1064
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1065
static
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1066
winEventProcessing(hWnd, message, wParam, lParam, pDefault)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1067
    HWND hWnd;                /* window handle                   */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1068
    UINT message;             /* type of message                 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1069
    UINT wParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1070
    LONG lParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1071
    int *pDefault;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1072
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1073
    LPMINMAXINFO lpmmi;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1074
    WINDOWPOS *posStruct;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1075
    RECT rct;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1076
    RECT upd;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1077
    int modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1078
    int x, y, w, h;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1079
    int isNative = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1080
    PAINTSTRUCT ps;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1081
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1082
/*
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1083
    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
  1084
			hWnd, message, wParam, lParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1085
*/
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1086
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1087
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1088
    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1089
     * messages which are enqueued to be handled by the view thread
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1090
     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1091
    switch (message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1092
	case WM_CREATE:
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
	      CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1095
	      SETLOCALWINDOWINFOPTR(hWnd,lpcs->lpCreateParams);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1096
	      if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1097
		PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1098
	      *pDefault = 0;
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(("CreateWindows %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
	      DPRINTF(("WM_CREATE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1104
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1105
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1106
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1107
	case WM_CLOSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1108
	    DPRINTF(("WM_CLOSE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1109
	    if (!destroyWin)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1110
	      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
  1111
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1112
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1113
	      destroyWin = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1114
	      if (!DestroyWindow(hWnd))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1115
	      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1116
		DPRINTF(("DestroyWindow ERROR\n"));
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
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
	    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1121
	    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1122
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1123
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1124
	case WM_DESTROY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1125
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1126
	      char *n = 0;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  1127
	      char *l;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1128
	      DPRINTF(("WM_DESTROY\n"));
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  1129
	      l = (char *)GETLOCALWINDOWINFOPTR(hWnd);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1130
#ifdef TOPWINDOWCLASS
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1131
	      if (l)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1132
	      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1133
		if (GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1134
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1135
		  n = (char*)malloc(200);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1136
		  GetClassName(hWnd,n,200);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1137
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1138
	      /* free all resources */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1139
		/*if (GetWindow_bgBrush(hWnd))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1140
		  DelObject(GetWindow_bgBrush(hWnd));*/
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1141
		//free(GETLOCALWINDOWINFOPTR(hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1142
	      }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1143
#endif
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1144
	      SETLOCALWINDOWINFOPTR(hWnd,0);
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1145
	      enqEvent(0,hWnd, message, wParam, (int)n, (int)l, 0, 0);
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1146
#ifdef COUNT_RESOURCES
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1147
	      __cnt_createWindows--;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1148
	      RESPRINTF(("DestroyWindows %d\n",__cnt_createWindows));
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1149
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1150
	      *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1151
	      return 0;
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
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1154
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1155
	case WM_GETMINMAXINFO:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1156
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1157
		lpmmi = (LPMINMAXINFO) lParam;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1158
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1159
		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
  1160
			    hWnd,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1161
			    lpmmi->ptMinTrackSize.x,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1162
			    lpmmi->ptMinTrackSize.y));
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
		if (GETLOCALWINDOWINFOPTR(hWnd) &&
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1165
		    GETLOCALWINDOWINFOPTR(hWnd)->minWidth &&
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1166
		    GETLOCALWINDOWINFOPTR(hWnd)->maxWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1167
		   )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1168
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1169
		  lpmmi->ptMaxSize.x = GETLOCALWINDOWINFOPTR(hWnd)->maxWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1170
		  lpmmi->ptMaxSize.y = GETLOCALWINDOWINFOPTR(hWnd)->maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1171
		  lpmmi->ptMaxTrackSize.x = GETLOCALWINDOWINFOPTR(hWnd)->maxWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1172
		  lpmmi->ptMaxTrackSize.y = GETLOCALWINDOWINFOPTR(hWnd)->maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1173
		  lpmmi->ptMinTrackSize.x = GETLOCALWINDOWINFOPTR(hWnd)->minWidth;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1174
		  lpmmi->ptMinTrackSize.y = GETLOCALWINDOWINFOPTR(hWnd)->minHeight;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1175
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1176
		  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
  1177
				  hWnd,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1178
				  GETLOCALWINDOWINFOPTR(hWnd)->minWidth, GETLOCALWINDOWINFOPTR(hWnd)->minHeight,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1179
				  GETLOCALWINDOWINFOPTR(hWnd)->maxWidth, GETLOCALWINDOWINFOPTR(hWnd)->maxHeight));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1180
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1181
		*pDefault = 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
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1184
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1185
	case WM_SETCURSOR:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1186
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1187
		HCURSOR curs;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1188
		int hitCode;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1189
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1190
		hitCode = LOWORD(lParam);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1191
		if (hitCode != HTCLIENT) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1192
		    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1193
		     * not in client area ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1194
		     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1195
		    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1196
		}
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  1197
		DDPRINTF(("WM_SETCURSOR\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1198
		curs = GetWindow_Cursor(hWnd);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1199
		if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1200
		    SetCursor(curs);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1201
		    *pDefault = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1202
		    return 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1203
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1204
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1205
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1206
	    return 0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1207
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1208
	case WM_WINDOWPOSCHANGED:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1209
	    /*
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1210
	     * ignore child window messages ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1211
	     */
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1212
	    if (GetParent(hWnd)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1213
		break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1214
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1215
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1216
	    {
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1217
		WINDOWPOS *wp = (WINDOWPOS *)lParam;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1218
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1219
		GetClientRect(hWnd, &rct);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1220
		DPRINTF(("WM_WINDOWPOSCHANGED %d %d %d %d %x ->",wp->x,wp->y,wp->cx,wp->cy,wp->flags));
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1221
		DPRINTF(("%d %d %d %d\n",rct.left, rct.top,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1222
				   rct.right-rct.left,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1223
				   rct.bottom-rct.top));
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1224
		enqEvent(0,hWnd, message, wParam,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1225
				   rct.left, rct.top,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1226
				   rct.right-rct.left,
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1227
				   rct.bottom-rct.top);
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1228
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1229
	    return 0;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1230
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1231
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1232
	case WM_ERASEBKGND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1233
	    EVENT_PRINTF(("WM_ERASEBKGND\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1234
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1235
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1236
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1237
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1238
	    *pDefault = 0;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1239
	    return 1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1240
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1241
	case WM_PAINT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1242
	    EVENT_PRINTF(("WM_PAINT\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1243
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1244
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1245
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1246
	    }
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1247
	    if (((GetWindow_Flag(hWnd) & LI_INPUTWIN) == 0) && (__rootWinSpezial != hWnd))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1248
	    {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1249
	      if (GetUpdateRect(hWnd, &upd, FALSE))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1250
	      {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1251
		  if (GetWindow_eventMask(hWnd) & ExposureMask)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1252
		    enqEvent(ExposureMask,hWnd, message, wParam, upd.left, upd.top, upd.right, upd.bottom);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1253
	      }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1254
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1255
	    else
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1256
	      pDefault = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1257
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1258
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1259
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1260
	case WM_SIZE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1261
	    EVENT_PRINTF(("WM_SIZE\n"));
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1262
#if 0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1263
	    switch(wParam)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1264
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1265
	      case SIZE_RESTORED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1266
	      case SIZE_MAXIMIZED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1267
		GetClientRect(hWnd, (LPRECT) &upd);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1268
		if (GetWindow_eventMask(hWnd) & ExposureMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1269
		  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
  1270
		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
  1271
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1272
	    }
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1273
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1274
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1275
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1276
	case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1277
	    EVENT_PRINTF(("WM_SHOWWINDOW\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1278
	    enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1279
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1280
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1281
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1282
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1283
	    break;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1284
	    //*pDefault = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1285
	    //return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1286
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1287
	case WM_MOUSEACTIVATE :
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1288
	    EVENT_PRINTF2(("WM_MOUSEACTIVATE h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1289
	    *pDefault = 0;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1290
	    if ((__rootWinSpezial == hWnd) || (GetActiveWindow() && (LOWORD(lParam) == HTCLIENT))
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1291
		/*((GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN) == 0) */
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1292
	       )
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1293
	       return MA_NOACTIVATE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1294
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1295
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1296
	      return MA_ACTIVATE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1297
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1298
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1299
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1300
	case WM_NCHITTEST:
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1301
	    EVENT_PRINTF(("WM_NCHITTEST\n"));
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1302
	    if (hWnd == __rootWinSpezial)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1303
	    {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1304
	      *pDefault = 0;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1305
	      return HTCLIENT;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1306
	    }
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1307
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1308
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1309
	case WM_NCACTIVATE:
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1310
	    EVENT_PRINTF(("WM_NCACTIVATE\n"));
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1311
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1312
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1313
	case WM_ACTIVATE:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1314
	    CPRINTF(("WM_ACTIVATE %s h=%x\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1315
			    LOWORD(wParam) ? "active" : "inactive",
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1316
			    hWnd));
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1317
#if 1
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1318
	    //enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1319
	    switch (LOWORD(wParam)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1320
		case WA_INACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1321
		    EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
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_ACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1324
		    EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1325
		    if (currentCapture == CAPTURE_NONE)
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1326
		    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1327
		      POINT p;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1328
		      HWND hWndChild,hWndTemp;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1329
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1330
		      p.x = evRootX;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1331
		      p.y = evRootY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1332
		      ScreenToClient(hWnd, &p);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1333
		      hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1334
		      do
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1335
		      {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1336
			hWndTemp = hWndChild;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1337
			hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1338
		      } while ((hWndChild) && (hWndChild != hWndTemp));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1339
		      /*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
  1340
		      if (hWndChild /*&& (hWndChild != hWnd)*/)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1341
		      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1342
			  modifiers = getModifiers();
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1343
			  if (hWndChild != currentPointerView)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1344
			  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1345
			      if (currentPointerView)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1346
			      {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1347
				  if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1348
				    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
  1349
				  currentPointerView = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1350
			      }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1351
			      if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1352
				enqEvent(EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1353
			      //SetFocus(hWndChild);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1354
			      currentPointerView = hWndChild;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1355
			  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1356
		      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1357
		    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1358
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1359
		case WA_CLICKACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1360
		    EVENT_PRINTF2(("WM_ACTIVATE clkactive h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1361
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1362
		default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1363
		    EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1364
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1365
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1366
	    if (isNative) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1367
		*pDefault = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1368
		return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1369
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1370
	    *pDefault = 0;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1371
	    return 0;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1372
#endif
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1373
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1374
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1375
	case WM_SYSCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1376
	    EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1377
	    goto commonChar;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1378
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1379
	case WM_CHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1380
	    EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1381
	commonChar:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1382
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1383
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1384
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1385
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1386
	    modifiers = getModifiers();
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1387
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1388
		POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1389
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1390
		p.x = evRootX;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1391
		p.y = evRootY;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1392
		ScreenToClient(hWnd, &p);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1393
		x = p.x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1394
		y = p.y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1395
	    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1396
	    if (currentPointerView) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1397
	      int evMask = GetWindow_eventMask(currentPointerView);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1398
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1399
	      if (evMask & KeyPressMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1400
		enqEvent(KeyPressMask,currentPointerView, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1401
	      if (evMask & KeyReleaseMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1402
		enqEvent(KeyReleaseMask,currentPointerView, WM_KEYUP, wParam, x, y, lParam, modifiers | TRANSLATED_KEY);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1403
	    } else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1404
	      int evMask = GetWindow_eventMask(hWnd);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1405
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1406
	      if (evMask & KeyPressMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1407
		enqEvent(KeyPressMask,hWnd, WM_KEYDOWN, wParam, x, y, lParam, modifiers | TRANSLATED_KEY);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1408
	      if (evMask & KeyReleaseMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1409
		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
  1410
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1411
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1412
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1413
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1414
	case WM_KEYUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1415
	    EVENT_PRINTF2(("WM_KEYUP h=%x %x\n", hWnd, wParam));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1416
	    goto commonKeyUp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1417
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1418
	case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1419
	    EVENT_PRINTF2(("WM_SYSKEYUP %x\n, wParam"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1420
	commonKeyUp:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1421
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1422
		*pDefault = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1423
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1424
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1425
	    modifiers = getModifiers();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1426
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1427
		POINT p;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1428
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1429
		p.x = evRootX;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1430
		p.y = evRootY;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1431
		ScreenToClient(hWnd, &p);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1432
		x = p.x;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1433
		y = p.y;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1434
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1435
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1436
	    if (currentPointerView) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1437
	      if (GetWindow_eventMask(currentPointerView) & KeyReleaseMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1438
		enqEvent(KeyReleaseMask,currentPointerView, message, wParam, x, y, lParam, modifiers);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1439
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1440
	      if (GetWindow_eventMask(hWnd) & KeyReleaseMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1441
		enqEvent(KeyReleaseMask,hWnd, message, wParam, x, y, lParam, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1442
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1443
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1444
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1445
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1446
	case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1447
	    EVENT_PRINTF2(("WM_SYSKEYDOWN %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1448
	    goto commonKey;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1449
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1450
	case WM_KEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1451
	    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
  1452
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1453
	    /* while debugging ... */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1454
	    if (wParam == VK_ESCAPE) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1455
		ReleaseCapture();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1456
		currentCapture = CAPTURE_NONE;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1457
		CPRINTF(("ReleaseCapture <ESC>\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1458
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1459
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1460
	commonKey:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1461
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1462
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1463
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1464
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1465
	    modifiers = getModifiers();
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1466
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1467
		POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1468
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1469
		p.x = evRootX;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1470
		p.y = evRootY;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1471
		ScreenToClient(hWnd, &p);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1472
		x = p.x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1473
		y = p.y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1474
	    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1475
	    if (currentPointerView) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1476
	      if (GetWindow_eventMask(currentPointerView) & KeyPressMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1477
		enqEvent(KeyPressMask,currentPointerView, message, wParam, x, y, lParam, modifiers);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1478
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1479
	      if (GetWindow_eventMask(hWnd) & KeyPressMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1480
		enqEvent(KeyPressMask,hWnd, message, wParam, x, y, lParam, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1481
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1482
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1483
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1484
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1485
	case WM_MOUSEMOVE:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1486
	    EVENT_PRINTF3(("WM_MOUSEMOVE h=%x\n", hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1487
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1488
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1489
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1490
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1491
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1492
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1493
		short x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1494
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1495
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1496
		y = (int)(short)HIWORD(lParam);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1497
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1498
		modifiers = getModifiers();
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1499
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1500
		if (currentCapture == CAPTURE_NONE)
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1501
		{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1502
		  if (hWnd != currentPointerView) {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1503
		      if (currentPointerView) {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1504
			  if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1505
			    enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1506
			  currentPointerView = 0;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1507
		      }
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1508
		      if (GetWindow_eventMask(hWnd) & EnterWindowMask)
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1509
			enqEvent(EnterWindowMask,hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1510
		      currentPointerView = hWnd;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1511
		  }
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1512
		  CPRINTF(("MouseMove %x\n",currentPointerView));
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1513
		}
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1514
		else
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1515
		{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1516
		  CPRINTF(("MouseMove Capture %x\n",currentPointerView));
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1517
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1518
		if (    (GetWindow_eventMask(currentPointerView) & PointerMotionMask)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1519
		     || (modifiers & (Button1Mask|Button2Mask|Button3Mask))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1520
		   )
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1521
		     enqEvent(PointerMotionMask,currentPointerView, message, wParam, x, y, 0, modifiers);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1522
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1523
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1524
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1525
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1526
	case WM_LBUTTONUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1527
	case WM_MBUTTONUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1528
	case WM_RBUTTONUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1529
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1530
		*pDefault = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1531
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1532
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1533
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1534
	    if (currentCapture == CAPTURE_IMPLICIT) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1535
		currentCapture = CAPTURE_NONE;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1536
		ReleaseCapture();
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1537
		CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1538
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1539
	    modifiers = getModifiers();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1540
	    EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1541
			   hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1542
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1543
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1544
	    if (GetWindow_eventMask(hWnd) & ButtonReleaseMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1545
	      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
  1546
					      wParam,modifiers);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1547
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1548
	    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1549
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1550
	case WM_LBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1551
	case WM_MBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1552
	case WM_RBUTTONDOWN:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1553
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1554
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1555
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1556
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1557
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1558
	    if (currentCapture == CAPTURE_NONE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1559
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1560
		currentCapture = CAPTURE_IMPLICIT;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1561
		//SetFocus(hWnd);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1562
		SetCapture(hWnd);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1563
		CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1564
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1565
	    goto commonButton;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1566
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1567
	case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1568
	case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1569
	case WM_RBUTTONDBLCLK:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1570
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1571
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1572
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1573
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1574
	commonButton:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1575
	    modifiers = getModifiers();
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1576
	    EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1577
			   hWnd, LOWORD(lParam), HIWORD(lParam)));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1578
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1579
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1580
	    if (GetWindow_eventMask(hWnd) & ButtonPressMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1581
	      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
  1582
					      wParam,modifiers);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1583
	    *pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1584
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1585
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1586
	case WM_CAPTURECHANGED:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1587
	    CPRINTF(("WM_CAPTURECHANGED %x to %x\n",hWnd,lParam));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1588
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1589
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1590
	case WM_KILLFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1591
	    CPRINTF(("WM_KILLFOCUS\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1592
	    //enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1593
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1594
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1595
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1596
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1597
	    *pDefault = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1598
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1599
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1600
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1601
	case WM_SETFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1602
	    CPRINTF(("WM_SETFOCUS %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1603
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1604
	    //enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1605
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1606
	      POINT p;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1607
	      HWND hWndChild,hWndTemp;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1608
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1609
	      p.x = evRootX;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1610
	      p.y = evRootY;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1611
	      ScreenToClient(hWnd, &p);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1612
	      hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1613
	      do
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1614
	      {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1615
		hWndTemp = hWndChild;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1616
		hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1617
	      } while ((hWndChild) && (hWndChild != hWndTemp));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1618
	      /*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
  1619
	      if (hWndChild /*&& (hWndChild != hWnd)*/)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1620
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1621
		  modifiers = getModifiers();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1622
		  if (hWndChild != currentPointerView)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1623
		  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1624
		      if (currentPointerView)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1625
		      {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1626
			  if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1627
			    enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1628
			  currentPointerView = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1629
		      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1630
		      if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1631
			enqEvent(EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1632
		      //SetFocus(hWndChild);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1633
		      currentPointerView = hWndChild;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1634
		  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1635
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1636
	    }
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1637
#endif
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1638
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1639
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1640
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1641
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1642
	    *pDefault = 0;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1643
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1644
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1645
	case WM_STYLECHANGING:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1646
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1647
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1648
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1649
	case WM_STYLECHANGED:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1650
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1651
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1652
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1653
	case WM_GETTEXT:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1654
	    /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1655
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1656
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1657
	case WM_GETTEXTLENGTH:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1658
	    EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1659
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1660
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1661
	case WM_NCCREATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1662
	    EVENT_PRINTF(("WM_NCCREATE %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1663
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1664
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1665
	case WM_NCMOUSEMOVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1666
	    {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1667
		short x, y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1668
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1669
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1670
		y = (int)(short)HIWORD(lParam);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1671
		EVENT_PRINTF(("WM_NCMOUSEMOVE %d/%d\n", x, y));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1672
		lastNCMouseX = x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1673
		lastNCMouseY = y;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1674
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1675
		modifiers = getModifiers();
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1676
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1677
		if (currentCapture == CAPTURE_NONE)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1678
		{
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1679
		  if (hWnd != currentPointerView) {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1680
		      if (currentPointerView) {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1681
			  if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1682
			    enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1683
			  currentPointerView = 0;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1684
		      }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1685
		  }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1686
		}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1687
	    }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1688
	    *pDefault = 0;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1689
	    return 0;
1127
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_PARENTNOTIFY:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1693
	    EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1694
				hWnd, lParam, LOWORD(wParam)));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1695
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1696
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1697
	case WM_NCLBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1698
	    EVENT_PRINTF(("WM_NCLBUTTONDOWN\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1699
	    {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1700
		short x, y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1701
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1702
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1703
		y = (int)(short)HIWORD(lParam);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1704
		lastNCMouseX = x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1705
		lastNCMouseY = y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1706
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1707
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1708
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1709
	case WM_NCLBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1710
	    EVENT_PRINTF(("WM_NCLBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1711
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1712
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1713
	case WM_NCRBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1714
	    EVENT_PRINTF(("WM_NCRBUTTONDOWN\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1715
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1716
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1717
	case WM_NCRBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1718
	    EVENT_PRINTF(("WM_NCRBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1719
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1720
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1721
	case WM_NCMBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1722
	    EVENT_PRINTF(("WM_NCMBUTTONDOWN\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1723
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1724
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1725
	case WM_NCMBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1726
	    EVENT_PRINTF(("WM_NCMBUTTONUP\n"));
1127
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1729
	case WM_SETTEXT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1730
	    EVENT_PRINTF(("WM_SETTEXT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1731
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1732
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1733
	case 0x88:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1734
	    EVENT_PRINTF(("0x88 (undoc)\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1735
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1736
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1737
	case WM_NCCALCSIZE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1738
	    EVENT_PRINTF(("WM_NCCALCSIZE\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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1741
	case WM_NCPAINT:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1742
	    EVENT_PRINTF3(("WM_NCPAINT\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1743
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1744
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1745
	case WM_SYSCOMMAND:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1746
	    switch (wParam & ~0x000F) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1747
		case SC_CLOSE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1748
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1749
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1750
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1751
		case SC_MOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1752
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1753
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1754
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1755
		case SC_RESTORE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1756
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1757
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1758
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1759
		case SC_SIZE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1760
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1761
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1762
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1763
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1764
		    EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1765
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1766
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1767
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1768
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1769
	case WM_INITMENU:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1770
	    EVENT_PRINTF(("WM_INITMENU\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1771
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1772
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1773
	case WM_INITMENUPOPUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1774
	    EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1775
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1776
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1777
	case WM_ENTERIDLE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1778
	    EVENT_PRINTF(("WM_ENTERIDLE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1779
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1780
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1781
	case WM_ENTERMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1782
	    EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1783
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1784
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1785
	case WM_EXITMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1786
	    EVENT_PRINTF(("WM_EXITMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1787
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1788
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1789
	case WM_MENUSELECT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1790
	    EVENT_PRINTF(("WM_MENUSELECT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1791
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1792
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1793
	case WM_QUIT:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1794
	    UNHANDLED_EVENT_PRINTF(("WM_QUIT\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1795
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1796
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1797
	case WM_NCDESTROY:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1798
	    EVENT_PRINTF(("WM_NCDESTROY\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1799
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1800
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1801
	case WM_QUERYNEWPALETTE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1802
	    EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1803
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1804
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1805
	case WM_PALETTECHANGED:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1806
	    EVENT_PRINTF(("WM_PALETTECHANGED\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1807
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1808
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1809
	case WM_ACTIVATEAPP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1810
	    EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1811
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1812
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1813
	case WM_SYSDEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1814
	    EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1815
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1816
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1817
	case WM_DEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1818
	    EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1819
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1820
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1821
	case WM_PAINTICON:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1822
	    EVENT_PRINTF(("WM_PAINTICON\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1823
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1824
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1825
	case WM_ICONERASEBKGND:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1826
	    EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1827
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1828
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1829
	case WM_WINDOWPOSCHANGING:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1830
	    EVENT_PRINTF(("WM_WINDOWPOSCHANGING\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1831
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1832
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1833
	case WM_QUERYOPEN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1834
	    EVENT_PRINTF(("WM_QUERYOPEN\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1835
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1836
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1837
	case WM_QUERYENDSESSION:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1838
	    EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1839
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1840
	    // TODO: enter new event loop
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1841
	    // which is left when an endSessionConfirmation
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1842
	    // arrives from smalltalk
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1843
	    // (either positive or negative).
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1844
	    // for now, do not allow leaving
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1845
	    // windows as long as ST/X is open.
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1846
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1847
	    *pDefault = 0;
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1848
	    return 0;    
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1849
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1850
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1851
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1852
	case WM_FONTCHANGE:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1853
	    UNHANDLED_EVENT_PRINTF(("WM_FONTCHANGE\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1854
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1855
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1856
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1857
	case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1858
	    EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1859
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1860
	    break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1861
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1862
	case WM_MOVING:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1863
	    EVENT_PRINTF(("WM_MOVING\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1864
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1865
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1866
	case WM_SIZING:
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1867
	    EVENT_PRINTF(("WM_SIZING\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1868
	    /*__debugEvent__();*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1869
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1870
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1871
	case WM_EXITSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1872
	    EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1873
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1874
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1875
	case WM_ENTERSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1876
	    EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1877
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1878
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1879
	case WM_MOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1880
	    EVENT_PRINTF(("WM_MOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1881
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1882
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1883
	case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1884
	    UNHANDLED_EVENT_PRINTF(("WM_POWER\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1885
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1886
	    break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1887
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1888
	default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1889
	    UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: unhandled msg = %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1890
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1891
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1892
    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1893
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1894
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1895
LONG APIENTRY
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1896
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1897
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1898
static void _USERENTRY
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1899
dispatchThread(void *arg)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1900
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1901
    static int th_calls;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1902
    RECT rect;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1903
    MSG msg;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1904
    localWindowInfo *li;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1905
    _dispatchThreadId = GetCurrentThreadId();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1906
    TH_DPRINTF(("TS %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1907
    PeekMessage(&msg,NULL,0,0,PM_NOREMOVE);   /* must be */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1908
#ifndef WIN32THREADS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1909
    AttachThreadInput(_dispatchThreadId,_masterThreadId,TRUE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1910
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1911
    /*SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1912
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1913
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1914
    GetWindowRect(GetDesktopWindow(), &rect);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1915
    /* allocate localMemory for Window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1916
    li = (localWindowInfo*)malloc(sizeof(localWindowInfo));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1917
    if (li)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1918
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1919
      memset(li,0,sizeof(*_thread_local));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1920
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1921
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1922
    __rootWinSpezial = CreateWindowEx( WS_EX_TOOLWINDOW|WS_EX_TRANSPARENT,app_nameroot,app_nameroot,
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1923
				       WS_POPUP|WS_DISABLED,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1924
				0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1925
				rect.right-rect.left,rect.bottom-rect.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1926
				0,0,(HANDLE) __getHInstance(),li);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1927
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1928
    /*printf("__rootWinSpezial %x\n",__rootWinSpezial);*/
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1929
    //ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1930
    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
  1931
    SetEvent(hCreateEvent);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1932
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1933
    while (bdispatchThreadState)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1934
    {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1935
	HANDLE dummy;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1936
	TH_DPRINTF(("TG %d\n", th_calls++));
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1937
	if (currentPointerView && (currentCapture == CAPTURE_NONE))
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1938
	{
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1939
	  while (PeekMessage(&msg,0,0,0,PM_NOREMOVE) == 0)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1940
	  {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1941
	    if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1942
	    {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1943
	      POINT point;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1944
	      if (GetCursorPos(&point))
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1945
	      {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1946
		HWND hWnd = WindowFromPoint(point);
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1947
		if (hWnd)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1948
		{
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1949
		  if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId())
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1950
		  {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1951
		    if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1952
		      enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers());
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1953
		    currentPointerView = 0;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1954
		    break;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1955
		  }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1956
		}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1957
	      }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1958
	    }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1959
	  }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1960
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1961
	GetMessage(&msg, NULL, 0, 0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1962
	TH_DPRINTF(("TD %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1963
	destroyWin = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1964
	if (msg.message == WM_THREADDESTROYWINDOW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1965
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1966
	  destroyWin = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1967
	  msg.message = WM_CLOSE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1968
	  CPRINTF(("thread WM_THREADDESTROYWINDOW %x\n",msg.hwnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1969
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1970
	else if (msg.message == WM_THREADSETFOCUS)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1971
	{
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1972
#ifdef xxWIN32THREADS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1973
	  if (msg.lParam)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1974
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1975
	    if (AttachThreadInput(_dispatchThreadId,msg.lParam,TRUE) == FALSE)
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  1976
	      PRINTF(("SetFocus AttachThreadInput error %d\n",GetLastError()));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1977
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1978
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1979
	  CPRINTF(("threadSetfocus %x\n",msg.wParam));
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1980
	  //SetForegroundWindow((HWND)msg.wParam);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1981
	  //SetWindowPos((HWND)msg.wParam, HWND_TOP, 0, 0, 0, 0, SWP_NOOWNERZORDER  |SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1982
	  SetFocus((HWND)msg.wParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1983
	  continue;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1984
	}
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1985
	else if (msg.message == WM_THREADSETCURSOR)
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1986
	{
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1987
	  if (msg.lParam)
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1988
	  {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1989
	    POINT p;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1990
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1991
	    GetCursorPos(&p);
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1992
	    if (WindowFromPoint(p) == msg.hwnd)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1993
	    {
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1994
	      CPRINTF(("threadSetCursor %x\n",msg.lParam));
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1995
	      SetCursor((HCURSOR)msg.lParam);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1996
	    }
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1997
	  }
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1998
	  continue;
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1999
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2000
	else if (msg.message == WM_THREADSETCAPTURE)
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
	  if (msg.wParam)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2003
	  {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2004
	    if (currentPointerView)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2005
	    {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2006
		if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2007
		  enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers());
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  2008
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2009
	    currentPointerView = msg.wParam;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2010
	    currentCapture = CAPTURE_EXPLICIT;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2011
	    CPRINTF(("threadSetCapture %x\n",msg.wParam));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2012
	    SetCapture(currentPointerView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2013
	  }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2014
	  else
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2015
	  {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2016
	    if (currentPointerView  == __rootWinSpezial)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2017
	    {
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2018
	      //ShowWindow(__rootWinSpezial, SW_HIDE);
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2019
	      SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,SWP_NOREDRAW|SWP_NOSENDCHANGING|SWP_NOCOPYBITS
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2020
			     |SWP_HIDEWINDOW| SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE/*| SWP_NOZORDER|SWP_NOOWNERZORDER*/);
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2021
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2022
	    currentPointerView = 0;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2023
	    currentCapture = CAPTURE_NONE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2024
	    CPRINTF(("threadReleaseCapture\n"));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2025
	    ReleaseCapture();
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2026
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2027
	  if (msg.lParam)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2028
	  {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2029
	      CPRINTF(("threadSetCursor %x\n",msg.lParam));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2030
	      SetCursor((HCURSOR)msg.lParam);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2031
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2032
	  continue;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2033
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2034
	else if (msg.message == WM_THREADCREATEWINDOW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2035
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2036
	  TH_DPRINTF(("C %d\n", th_calls));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2037
	  if (_thread_winStyleBits & WS_POPUP)
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2038
	  {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2039
	    //_thread_parentHandle = GetActiveWindow();
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2040
	  }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2041
	  _thread_newWinHandle = CreateWindowEx(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2042
				      _thread_winStyleBitsEx,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2043
				      _thread_className,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2044
				      _thread_windowName,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2045
				      _thread_winStyleBits,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2046
				      _thread_x, _thread_y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2047
				      _thread_dx,_thread_dy,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2048
				      _thread_parentHandle,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2049
				      NULL,           /* menu */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2050
				      (HANDLE) __getHInstance(),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2051
				      _thread_local);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2052
	  SetEvent(hCreateEvent);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2053
	  continue;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2054
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2055
	/* TranslateMessage(&msg); */ /* Translates virtual key codes */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2056
	if (   (msg.message == WM_KEYDOWN)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2057
	    || (msg.message == WM_KEYUP)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2058
	    || (msg.message == WM_SYSKEYDOWN)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2059
	    || (msg.message == WM_SYSKEYUP)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2060
	   )
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2061
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2062
#ifdef xxDEBUG
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2063
	   if ((msg.wParam == 0x11) && (msg.message == WM_KEYDOWN))/* CTRL-C */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2064
	   {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2065
	     if (c_count++ > 3)  /* for debugging */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2066
		exit(1);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2067
	   }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2068
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2069
	    /*printf("keymsg %x\n",msg.wParam);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2070
	    if (
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2071
		   ((msg.wParam >= '0') && (msg.wParam <= 'Z'))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2072
		|| (msg.wParam == 0x20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2073
		|| (msg.wParam == 0x14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2074
		/*|| (msg.wParam == 0x10)*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2075
		|| (msg.wParam >= 0xB0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2076
	       )
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2077
	    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2078
		/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2079
		 * translate to a WM_CHAR message
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
		if (TranslateMessage(&msg))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2082
		    continue;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2083
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2084
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2085
	evRootX = msg.pt.x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2086
	evRootY = msg.pt.y;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2087
	lastMSGTime = msg.time;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2088
	DispatchMessage(&msg);   /* Dispatches message to window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2089
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2090
    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2091
}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2092
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2093
LONG APIENTRY
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2094
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2095
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2096
    int wantDefault = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2097
    int retVal;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2098
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2099
    TH_DPRINTF(("TMW %d\n",message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2100
    retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2101
    if (wantDefault) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2102
	DDPRINTF((">>DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2103
	retVal = DefWindowProc(hWnd, message, wParam, lParam);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2104
	DDPRINTF(("<<DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2105
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2106
    return retVal;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2107
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2108
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2109
static int CALLBACK
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2110
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData )
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2111
	LOGFONT*        lplf;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2112
	TEXTMETRIC*     lptm;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2113
	DWORD           dwType;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2114
	LPARAM          lpData;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2115
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2116
	OBJ t;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2117
	OBJ* refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2118
	OBJ  typeFaceList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2119
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2120
	if (lplf) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2121
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2122
	    __PROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2123
	    t = __MKSTRING( lplf->lfFaceName );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2124
	    __UNPROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2125
	    typeFaceList = *refToList;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2126
	    __SSEND1( typeFaceList, @symbol(add:), 0, t );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2127
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2128
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2129
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2130
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2131
static int CALLBACK
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2132
EnumFontsProc( lplf, lptm, dwType, lpData )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2133
	LOGFONT*      lplf;     /* address of logical-font data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2134
	TEXTMETRIC*   lptm;     /* address of physical font data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2135
	DWORD         dwType;   /* font type */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2136
	LPARAM        lpData;   /* address of application supplied data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2137
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2138
	OBJ newArray, t;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2139
	OBJ *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2140
	OBJ list;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2141
	char *s;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2142
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2143
	DPRINTF(("EnumFontProc\n\n\n\n"));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2144
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2145
	if( lplf ) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2146
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2147
	    __PROTECT__(*refToList);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2148
	    DPRINTF((" lfHeight          %d\n", lplf->lfHeight ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2149
	    DPRINTF((" lfWidth           %d\n", lplf->lfWidth  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2150
	    DPRINTF((" lfEscapement      %d\n", lplf->lfEscapement  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2151
	    DPRINTF((" lfOrientation     %d\n", lplf->lfOrientation  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2152
	    DPRINTF((" lfWeight          %d\n", lplf->lfWeight  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2153
	    DPRINTF((" lfItalic          %d\n", lplf->lfItalic  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2154
	    DPRINTF((" lfUnderline       %d\n", lplf->lfUnderline  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2155
	    DPRINTF((" lfStrikeOut       %d\n", lplf->lfStrikeOut  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2156
	    DPRINTF((" lfCharSet         %d\n", lplf->lfCharSet  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2157
	    DPRINTF((" lfOutPrecision    %d\n", lplf->lfOutPrecision  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2158
	    DPRINTF((" lfClipPrecision   %d\n", lplf->lfClipPrecision  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2159
	    DPRINTF((" lfQuality         %d\n", lplf->lfQuality  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2160
	    DPRINTF((" lfPitchAndFamily  %d\n", lplf->lfPitchAndFamily  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2161
	    DPRINTF((" lfFaceName        %s\n\n", lplf->lfFaceName  ));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2162
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2163
	    newArray = __ARRAY_NEW_INT(16);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2164
	    __UNPROTECT__(*refToList);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2165
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2166
	    if ( dwType & TRUETYPE_FONTTYPE )
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2167
	      __ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(0);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2168
	    else
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2169
	      //__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
  2170
	      __ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2171
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2172
	    __ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2173
	    __ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2174
	    __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
  2175
	    switch (lplf->lfWeight) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2176
		case FW_NORMAL:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2177
		    s = "normal";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2178
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2179
		case FW_BOLD:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2180
		    s = "bold";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2181
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2182
		case FW_MEDIUM:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2183
		    s = "medium";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2184
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2185
		case FW_LIGHT:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2186
		    s = "demi";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2187
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2188
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2189
		    s = "other";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2190
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2191
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2192
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2193
	    __PROTECT__(newArray);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2194
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2195
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2196
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2197
	    __ArrayInstPtr(newArray)->a_element[4] = t; __STORE(newArray, t);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2198
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2199
	    if( lplf->lfItalic == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2200
		if( lplf->lfUnderline == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2201
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2202
			s = "italic-underline-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2203
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2204
			s = "italic-underline";
1416
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->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2208
			s = "italic-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2209
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2210
			s = "italic";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2211
		    }
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->lfUnderline == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2215
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2216
			s = "underline-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2217
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2218
			s = "underline";
1416
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
		} else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2221
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2222
			s = "strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2223
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2224
			s = "normal";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2225
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2226
		}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2227
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2228
	    __PROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2229
	    __PROTECT__(newArray);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2230
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2231
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2232
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2233
	    __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
  2234
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2235
	    __ArrayInstPtr(newArray)->a_element[5] = __MKSMALLINT(lplf->lfItalic);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2236
	    __ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfUnderline);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2237
	    __ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfStrikeOut);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2238
	    __ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfCharSet);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2239
	    __ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfOutPrecision);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2240
	    __ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfClipPrecision);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2241
	    __ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfQuality);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2242
	    __ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfPitchAndFamily);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2243
	    /* ... */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2244
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2245
	    __PROTECT__(newArray);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2246
	    t = __MKSTRING(lplf->lfFaceName);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2247
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2248
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2249
	    __ArrayInstPtr(newArray)->a_element[13] = t; __STORE(newArray, t);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2250
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2251
	    switch (lplf->lfCharSet) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2252
		case ANSI_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2253
		    s = "ansi";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2254
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2255
		case DEFAULT_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2256
		    s = "default";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2257
		case SYMBOL_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2258
		    s = "symbol";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2259
		case SHIFTJIS_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2260
		    s = "sjis";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2261
		case GB2312_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2262
		    s = "gb";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2263
		case HANGEUL_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2264
		    s = "hangeul";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2265
		case CHINESEBIG5_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2266
		    s = "big5";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2267
		case OEM_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2268
		    s = "oem";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2269
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2270
# ifdef JOHAB_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2271
		case JOHAB_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2272
		    s = "johab";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2273
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2274
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2275
# ifdef HEBREW_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2276
		case HEBREW_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2277
		    s = "hebrew";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2278
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2279
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2280
# ifdef GREEK_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2281
		case GREEK_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2282
		    s = "greek";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2283
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2284
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2285
# ifdef RUSSIAN_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2286
		case RUSSIAN_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2287
		    s = "russian";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2288
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2289
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2290
# ifdef MAC_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2291
		case MAC_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2292
		    s = "mac";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2293
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2294
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2295
		default:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2296
		    s = "unknown";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2297
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2298
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2299
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2300
	    __PROTECT__(newArray);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2301
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2302
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2303
	    __UNPROTECT__(*refToList);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2304
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2305
	    __ArrayInstPtr(newArray)->a_element[14] = t; __STORE(newArray, t);
1416
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
	    list = *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2308
	    __SSEND1(list, @symbol(add:), 0, newArray);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2309
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2310
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2311
	DPRINTF((" dwType            %d\n", dwType ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2312
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2313
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2314
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2315
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2316
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2317
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2318
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2319
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2320
copyright
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2321
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2322
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2323
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2324
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2325
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2326
 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
  2327
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2328
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2329
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2330
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2331
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2332
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2333
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2334
documentation
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2335
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2336
    See more documentation in my superclass, DeviceWorkstation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2337
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2338
    [author:]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2339
	Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2340
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2341
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2342
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2343
!WinWorkstation class methodsFor:'initialization'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2344
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2345
initialize
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2346
    |nButtons swap|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2347
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2348
    super initialize.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2349
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2350
    self initializeStandardColorNames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2351
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2352
    NativeWindows := false.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2353
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2354
    BeepFrequency := 440.       "/ Hertz
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2355
    BeepDuration := 200.        "/ millis
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2356
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2357
    ButtonTranslation := #(1 2 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2358
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2359
    nButtons := self getSystemMetrics:#mouseButtons.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2360
    swap := self getSystemMetrics:#swapButton.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2361
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2362
    nButtons == 0 ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2363
	'WinWorkstation [warning]: mouse-less operation may not work' infoPrintCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2364
    ] ifFalse:[
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2365
	nButtons == 2 ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2366
	    ButtonTranslation := #(1 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2367
	].
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2368
	swap ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2369
	    ButtonTranslation := ButtonTranslation copy reverse
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2370
	]
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2371
    ].
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2372
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2373
    "/ translation table from ST/X windowType symbol (system-independent)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2374
    "/ to Windows windowClass (windows-specific).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2375
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2376
    NativeWindowClassTable := IdentityDictionary new.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2377
    NativeWindowClassTable at:#ScrollBar     put:'SCROLLBAR'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2378
    NativeWindowClassTable at:#CheckBox      put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2379
    NativeWindowClassTable at:#RadioButton   put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2380
    NativeWindowClassTable at:#Button        put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2381
    NativeWindowClassTable at:#DefaultButton put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2382
    NativeWindowClassTable at:#ComboBox      put:'COMBOBOX'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2383
    NativeWindowClassTable at:#EditField     put:'EDIT'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2384
    NativeWindowClassTable at:#ListBox       put:'LISTBOX'.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2385
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2386
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2387
initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2388
    "{ Pragma: +optSpace }"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2389
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2390
    "setup standard color names"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2391
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2392
    StandardColorValues := Dictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2393
    #(
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2394
	(240 248 255)   'alice blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2395
	(240 248 255)   'AliceBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2396
	(250 235 215)   'antique white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2397
	(250 235 215)   'AntiqueWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2398
	(255 239 219)   'AntiqueWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2399
	(238 223 204)   'AntiqueWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2400
	(205 192 176)   'AntiqueWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2401
	(139 131 120)   'AntiqueWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2402
	(127 255 212)   'aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2403
	(127 255 212)   'aquamarine1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2404
	(118 238 198)   'aquamarine2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2405
	(102 205 170)   'aquamarine3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2406
	( 69 139 116)   'aquamarine4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2407
	(240 255 255)   'azure'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2408
	(240 255 255)   'azure1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2409
	(224 238 238)   'azure2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2410
	(193 205 205)   'azure3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2411
	(131 139 139)   'azure4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2412
	(245 245 220)   'beige'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2413
	(255 228 196)   'bisque'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2414
	(255 228 196)   'bisque1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2415
	(238 213 183)   'bisque2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2416
	(205 183 158)   'bisque3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2417
	(139 125 107)   'bisque4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2418
	(  0   0   0)   'black'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2419
	(255 235 205)   'blanched almond'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2420
	(255 235 205)   'BlanchedAlmond'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2421
	(  0   0 255)   'blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2422
	(138  43 226)   'blue violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2423
	(  0   0 255)   'blue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2424
	(  0   0 238)   'blue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2425
	(  0   0 205)   'blue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2426
	(  0   0 139)   'blue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2427
	(138  43 226)   'BlueViolet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2428
	(165  42  42)   'brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2429
	(255  64  64)   'brown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2430
	(238  59  59)   'brown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2431
	(205  51  51)   'brown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2432
	(139  35  35)   'brown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2433
	(222 184 135)   'burlywood'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2434
	(255 211 155)   'burlywood1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2435
	(238 197 145)   'burlywood2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2436
	(205 170 125)   'burlywood3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2437
	(139 115  85)   'burlywood4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2438
	( 95 158 160)   'cadet blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2439
	( 95 158 160)   'CadetBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2440
	(152 245 255)   'CadetBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2441
	(142 229 238)   'CadetBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2442
	(122 197 205)   'CadetBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2443
	( 83 134 139)   'CadetBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2444
	(127 255   0)   'chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2445
	(127 255   0)   'chartreuse1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2446
	(118 238   0)   'chartreuse2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2447
	(102 205   0)   'chartreuse3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2448
	( 69 139   0)   'chartreuse4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2449
	(210 105  30)   'chocolate'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2450
	(255 127  36)   'chocolate1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2451
	(238 118  33)   'chocolate2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2452
	(205 102  29)   'chocolate3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2453
	(139  69  19)   'chocolate4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2454
	(255 127  80)   'coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2455
	(255 114  86)   'coral1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2456
	(238 106  80)   'coral2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2457
	(205  91  69)   'coral3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2458
	(139  62  47)   'coral4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2459
	(100 149 237)   'cornflower blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2460
	(100 149 237)   'CornflowerBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2461
	(255 248 220)   'cornsilk'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2462
	(255 248 220)   'cornsilk1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2463
	(238 232 205)   'cornsilk2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2464
	(205 200 177)   'cornsilk3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2465
	(139 136 120)   'cornsilk4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2466
	(  0 255 255)   'cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2467
	(  0 255 255)   'cyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2468
	(  0 238 238)   'cyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2469
	(  0 205 205)   'cyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2470
	(  0 139 139)   'cyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2471
	(  0   0 139)   'dark blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2472
	(  0 139 139)   'dark cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2473
	(184 134  11)   'dark goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2474
	(169 169 169)   'dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2475
	(  0 100   0)   'dark green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2476
	(169 169 169)   'dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2477
	(189 183 107)   'dark khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2478
	(139   0 139)   'dark magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2479
	( 85 107  47)   'dark olive green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2480
	(255 140   0)   'dark orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2481
	(153  50 204)   'dark orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2482
	(139   0   0)   'dark red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2483
	(233 150 122)   'dark salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2484
	(143 188 143)   'dark sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2485
	( 72  61 139)   'dark slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2486
	( 47  79  79)   'dark slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2487
	( 47  79  79)   'dark slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2488
	(  0 206 209)   'dark turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2489
	(148   0 211)   'dark violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2490
	(  0   0 139)   'DarkBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2491
	(  0 139 139)   'DarkCyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2492
	(184 134  11)   'DarkGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2493
	(255 185  15)   'DarkGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2494
	(238 173  14)   'DarkGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2495
	(205 149  12)   'DarkGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2496
	(139 101   8)   'DarkGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2497
	(169 169 169)   'DarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2498
	(  0 100   0)   'DarkGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2499
	(169 169 169)   'DarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2500
	(189 183 107)   'DarkKhaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2501
	(139   0 139)   'DarkMagenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2502
	( 85 107  47)   'DarkOliveGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2503
	(202 255 112)   'DarkOliveGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2504
	(188 238 104)   'DarkOliveGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2505
	(162 205  90)   'DarkOliveGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2506
	(110 139  61)   'DarkOliveGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2507
	(255 140   0)   'DarkOrange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2508
	(255 127   0)   'DarkOrange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2509
	(238 118   0)   'DarkOrange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2510
	(205 102   0)   'DarkOrange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2511
	(139  69   0)   'DarkOrange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2512
	(153  50 204)   'DarkOrchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2513
	(191  62 255)   'DarkOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2514
	(178  58 238)   'DarkOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2515
	(154  50 205)   'DarkOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2516
	(104  34 139)   'DarkOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2517
	(139   0   0)   'DarkRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2518
	(233 150 122)   'DarkSalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2519
	(143 188 143)   'DarkSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2520
	(193 255 193)   'DarkSeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2521
	(180 238 180)   'DarkSeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2522
	(155 205 155)   'DarkSeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2523
	(105 139 105)   'DarkSeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2524
	( 72  61 139)   'DarkSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2525
	( 47  79  79)   'DarkSlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2526
	(151 255 255)   'DarkSlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2527
	(141 238 238)   'DarkSlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2528
	(121 205 205)   'DarkSlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2529
	( 82 139 139)   'DarkSlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2530
	( 47  79  79)   'DarkSlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2531
	(  0 206 209)   'DarkTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2532
	(148   0 211)   'DarkViolet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2533
	(255  20 147)   'deep pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2534
	(  0 191 255)   'deep sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2535
	(255  20 147)   'DeepPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2536
	(255  20 147)   'DeepPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2537
	(238  18 137)   'DeepPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2538
	(205  16 118)   'DeepPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2539
	(139  10  80)   'DeepPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2540
	(  0 191 255)   'DeepSkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2541
	(  0 191 255)   'DeepSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2542
	(  0 178 238)   'DeepSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2543
	(  0 154 205)   'DeepSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2544
	(  0 104 139)   'DeepSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2545
	(105 105 105)   'dim gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2546
	(105 105 105)   'dim grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2547
	(105 105 105)   'DimGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2548
	(105 105 105)   'DimGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2549
	( 30 144 255)   'dodger blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2550
	( 30 144 255)   'DodgerBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2551
	( 30 144 255)   'DodgerBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2552
	( 28 134 238)   'DodgerBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2553
	( 24 116 205)   'DodgerBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2554
	( 16  78 139)   'DodgerBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2555
	(178  34  34)   'firebrick'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2556
	(255  48  48)   'firebrick1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2557
	(238  44  44)   'firebrick2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2558
	(205  38  38)   'firebrick3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2559
	(139  26  26)   'firebrick4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2560
	(255 250 240)   'floral white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2561
	(255 250 240)   'FloralWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2562
	( 34 139  34)   'forest green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2563
	( 34 139  34)   'ForestGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2564
	(220 220 220)   'gainsboro'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2565
	(248 248 255)   'ghost white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2566
	(248 248 255)   'GhostWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2567
	(255 215   0)   'gold'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2568
	(255 215   0)   'gold1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2569
	(238 201   0)   'gold2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2570
	(205 173   0)   'gold3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2571
	(139 117   0)   'gold4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2572
	(218 165  32)   'goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2573
	(255 193  37)   'goldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2574
	(238 180  34)   'goldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2575
	(205 155  29)   'goldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2576
	(139 105  20)   'goldenrod4'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2577
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2578
	(192 192 192)   'grey'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2579
	(  0   0   0)   'grey0'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2580
	(  3   3   3)   'grey1'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2581
	( 26  26  26)   'grey10'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2582
	(255 255 255)   'grey100'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2583
	( 28  28  28)   'grey11'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2584
	( 31  31  31)   'grey12'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2585
	( 33  33  33)   'grey13'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2586
	( 36  36  36)   'grey14'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2587
	( 38  38  38)   'grey15'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2588
	( 41  41  41)   'grey16'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2589
	( 43  43  43)   'grey17'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2590
	( 46  46  46)   'grey18'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2591
	( 48  48  48)   'grey19'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2592
	(  5   5   5)   'grey2'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2593
	( 51  51  51)   'grey20'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2594
	( 54  54  54)   'grey21'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2595
	( 56  56  56)   'grey22'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2596
	( 59  59  59)   'grey23'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2597
	( 61  61  61)   'grey24'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2598
	( 64  64  64)   'grey25'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2599
	( 66  66  66)   'grey26'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2600
	( 69  69  69)   'grey27'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2601
	( 71  71  71)   'grey28'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2602
	( 74  74  74)   'grey29'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2603
	(  8   8   8)   'grey3'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2604
	( 77  77  77)   'grey30'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2605
	( 79  79  79)   'grey31'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2606
	( 82  82  82)   'grey32'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2607
	( 84  84  84)   'grey33'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2608
	( 87  87  87)   'grey34'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2609
	( 89  89  89)   'grey35'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2610
	( 92  92  92)   'grey36'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2611
	( 94  94  94)   'grey37'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2612
	( 97  97  97)   'grey38'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2613
	( 99  99  99)   'grey39'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2614
	( 10  10  10)   'grey4'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2615
	(102 102 102)   'grey40'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2616
	(105 105 105)   'grey41'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2617
	(107 107 107)   'grey42'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2618
	(110 110 110)   'grey43'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2619
	(112 112 112)   'grey44'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2620
	(115 115 115)   'grey45'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2621
	(117 117 117)   'grey46'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2622
	(120 120 120)   'grey47'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2623
	(122 122 122)   'grey48'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2624
	(125 125 125)   'grey49'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2625
	( 13  13  13)   'grey5'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2626
	(127 127 127)   'grey50'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2627
	(130 130 130)   'grey51'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2628
	(133 133 133)   'grey52'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2629
	(135 135 135)   'grey53'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2630
	(138 138 138)   'grey54'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2631
	(140 140 140)   'grey55'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2632
	(143 143 143)   'grey56'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2633
	(145 145 145)   'grey57'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2634
	(148 148 148)   'grey58'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2635
	(150 150 150)   'grey59'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2636
	( 15  15  15)   'grey6'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2637
	(153 153 153)   'grey60'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2638
	(156 156 156)   'grey61'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2639
	(158 158 158)   'grey62'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2640
	(161 161 161)   'grey63'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2641
	(163 163 163)   'grey64'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2642
	(166 166 166)   'grey65'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2643
	(168 168 168)   'grey66'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2644
	(171 171 171)   'grey67'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2645
	(173 173 173)   'grey68'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2646
	(176 176 176)   'grey69'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2647
	( 18  18  18)   'grey7'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2648
	(179 179 179)   'grey70'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2649
	(181 181 181)   'grey71'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2650
	(184 184 184)   'grey72'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2651
	(186 186 186)   'grey73'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2652
	(189 189 189)   'grey74'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2653
	(191 191 191)   'grey75'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2654
	(194 194 194)   'grey76'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2655
	(196 196 196)   'grey77'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2656
	(199 199 199)   'grey78'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2657
	(201 201 201)   'grey79'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2658
	( 20  20  20)   'grey8'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2659
	(204 204 204)   'grey80'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2660
	(207 207 207)   'grey81'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2661
	(209 209 209)   'grey82'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2662
	(212 212 212)   'grey83'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2663
	(214 214 214)   'grey84'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2664
	(217 217 217)   'grey85'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2665
	(219 219 219)   'grey86'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2666
	(222 222 222)   'grey87'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2667
	(224 224 224)   'grey88'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2668
	(227 227 227)   'grey89'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2669
	( 23  23  23)   'grey9'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2670
	(229 229 229)   'grey90'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2671
	(232 232 232)   'grey91'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2672
	(235 235 235)   'grey92'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2673
	(237 237 237)   'grey93'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2674
	(240 240 240)   'grey94'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2675
	(242 242 242)   'grey95'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2676
	(245 245 245)   'grey96'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2677
	(247 247 247)   'grey97'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2678
	(250 250 250)   'grey98'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2679
	(252 252 252)   'grey99'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2680
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2681
	(192 192 192)   'gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2682
	(  0   0   0)   'gray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2683
	(  3   3   3)   'gray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2684
	( 26  26  26)   'gray10'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2685
	(255 255 255)   'gray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2686
	( 28  28  28)   'gray11'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2687
	( 31  31  31)   'gray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2688
	( 33  33  33)   'gray13'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2689
	( 36  36  36)   'gray14'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2690
	( 38  38  38)   'gray15'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2691
	( 41  41  41)   'gray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2692
	( 43  43  43)   'gray17'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2693
	( 46  46  46)   'gray18'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2694
	( 48  48  48)   'gray19'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2695
	(  5   5   5)   'gray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2696
	( 51  51  51)   'gray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2697
	( 54  54  54)   'gray21'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2698
	( 56  56  56)   'gray22'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2699
	( 59  59  59)   'gray23'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2700
	( 61  61  61)   'gray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2701
	( 64  64  64)   'gray25'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2702
	( 66  66  66)   'gray26'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2703
	( 69  69  69)   'gray27'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2704
	( 71  71  71)   'gray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2705
	( 74  74  74)   'gray29'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2706
	(  8   8   8)   'gray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2707
	( 77  77  77)   'gray30'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2708
	( 79  79  79)   'gray31'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2709
	( 82  82  82)   'gray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2710
	( 84  84  84)   'gray33'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2711
	( 87  87  87)   'gray34'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2712
	( 89  89  89)   'gray35'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2713
	( 92  92  92)   'gray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2714
	( 94  94  94)   'gray37'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2715
	( 97  97  97)   'gray38'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2716
	( 99  99  99)   'gray39'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2717
	( 10  10  10)   'gray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2718
	(102 102 102)   'gray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2719
	(105 105 105)   'gray41'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2720
	(107 107 107)   'gray42'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2721
	(110 110 110)   'gray43'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2722
	(112 112 112)   'gray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2723
	(115 115 115)   'gray45'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2724
	(117 117 117)   'gray46'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2725
	(120 120 120)   'gray47'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2726
	(122 122 122)   'gray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2727
	(125 125 125)   'gray49'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2728
	( 13  13  13)   'gray5'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2729
	(127 127 127)   'gray50'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2730
	(130 130 130)   'gray51'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2731
	(133 133 133)   'gray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2732
	(135 135 135)   'gray53'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2733
	(138 138 138)   'gray54'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2734
	(140 140 140)   'gray55'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2735
	(143 143 143)   'gray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2736
	(145 145 145)   'gray57'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2737
	(148 148 148)   'gray58'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2738
	(150 150 150)   'gray59'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2739
	( 15  15  15)   'gray6'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2740
	(153 153 153)   'gray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2741
	(156 156 156)   'gray61'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2742
	(158 158 158)   'gray62'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2743
	(161 161 161)   'gray63'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2744
	(163 163 163)   'gray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2745
	(166 166 166)   'gray65'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2746
	(168 168 168)   'gray66'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2747
	(171 171 171)   'gray67'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2748
	(173 173 173)   'gray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2749
	(176 176 176)   'gray69'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2750
	( 18  18  18)   'gray7'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2751
	(179 179 179)   'gray70'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2752
	(181 181 181)   'gray71'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2753
	(184 184 184)   'gray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2754
	(186 186 186)   'gray73'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2755
	(189 189 189)   'gray74'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2756
	(191 191 191)   'gray75'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2757
	(194 194 194)   'gray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2758
	(196 196 196)   'gray77'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2759
	(199 199 199)   'gray78'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2760
	(201 201 201)   'gray79'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2761
	( 20  20  20)   'gray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2762
	(204 204 204)   'gray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2763
	(207 207 207)   'gray81'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2764
	(209 209 209)   'gray82'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2765
	(212 212 212)   'gray83'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2766
	(214 214 214)   'gray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2767
	(217 217 217)   'gray85'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2768
	(219 219 219)   'gray86'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2769
	(222 222 222)   'gray87'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2770
	(224 224 224)   'gray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2771
	(227 227 227)   'gray89'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2772
	( 23  23  23)   'gray9'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2773
	(229 229 229)   'gray90'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2774
	(232 232 232)   'gray91'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2775
	(235 235 235)   'gray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2776
	(237 237 237)   'gray93'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2777
	(240 240 240)   'gray94'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2778
	(242 242 242)   'gray95'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2779
	(245 245 245)   'gray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2780
	(247 247 247)   'gray97'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2781
	(250 250 250)   'gray98'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2782
	(252 252 252)   'gray99'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2783
	(  0 255   0)   'green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2784
	(173 255  47)   'green yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2785
	(  0 255   0)   'green1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2786
	(  0 238   0)   'green2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2787
	(  0 205   0)   'green3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2788
	(  0 139   0)   'green4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2789
	(173 255  47)   'GreenYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2790
	(240 255 240)   'honeydew'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2791
	(240 255 240)   'honeydew1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2792
	(224 238 224)   'honeydew2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2793
	(193 205 193)   'honeydew3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2794
	(131 139 131)   'honeydew4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2795
	(255 105 180)   'hot pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2796
	(255 105 180)   'HotPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2797
	(255 110 180)   'HotPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2798
	(238 106 167)   'HotPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2799
	(205  96 144)   'HotPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2800
	(139  58  98)   'HotPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2801
	(205  92  92)   'indian red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2802
	(205  92  92)   'IndianRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2803
	(255 106 106)   'IndianRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2804
	(238  99  99)   'IndianRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2805
	(205  85  85)   'IndianRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2806
	(139  58  58)   'IndianRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2807
	(255 255 240)   'ivory'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2808
	(255 255 240)   'ivory1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2809
	(238 238 224)   'ivory2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2810
	(205 205 193)   'ivory3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2811
	(139 139 131)   'ivory4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2812
	(240 230 140)   'khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2813
	(255 246 143)   'khaki1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2814
	(238 230 133)   'khaki2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2815
	(205 198 115)   'khaki3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2816
	(139 134  78)   'khaki4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2817
	(230 230 250)   'lavender'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2818
	(255 240 245)   'lavender blush'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2819
	(255 240 245)   'LavenderBlush'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2820
	(255 240 245)   'LavenderBlush1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2821
	(238 224 229)   'LavenderBlush2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2822
	(205 193 197)   'LavenderBlush3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2823
	(139 131 134)   'LavenderBlush4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2824
	(124 252   0)   'lawn green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2825
	(124 252   0)   'LawnGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2826
	(255 250 205)   'lemon chiffon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2827
	(255 250 205)   'LemonChiffon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2828
	(255 250 205)   'LemonChiffon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2829
	(238 233 191)   'LemonChiffon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2830
	(205 201 165)   'LemonChiffon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2831
	(139 137 112)   'LemonChiffon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2832
	(173 216 230)   'light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2833
	(240 128 128)   'light coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2834
	(224 255 255)   'light cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2835
	(238 221 130)   'light goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2836
	(250 250 210)   'light goldenrod yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2837
	(211 211 211)   'light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2838
	(144 238 144)   'light green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2839
	(211 211 211)   'light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2840
	(255 182 193)   'light pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2841
	(255 160 122)   'light salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2842
	( 32 178 170)   'light sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2843
	(135 206 250)   'light sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2844
	(132 112 255)   'light slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2845
	(119 136 153)   'light slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2846
	(119 136 153)   'light slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2847
	(176 196 222)   'light steel blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2848
	(255 255 224)   'light yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2849
	(173 216 230)   'LightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2850
	(191 239 255)   'LightBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2851
	(178 223 238)   'LightBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2852
	(154 192 205)   'LightBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2853
	(104 131 139)   'LightBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2854
	(240 128 128)   'LightCoral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2855
	(224 255 255)   'LightCyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2856
	(224 255 255)   'LightCyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2857
	(209 238 238)   'LightCyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2858
	(180 205 205)   'LightCyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2859
	(122 139 139)   'LightCyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2860
	(238 221 130)   'LightGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2861
	(255 236 139)   'LightGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2862
	(238 220 130)   'LightGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2863
	(205 190 112)   'LightGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2864
	(139 129  76)   'LightGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2865
	(250 250 210)   'LightGoldenrodYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2866
	(211 211 211)   'LightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2867
	(144 238 144)   'LightGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2868
	(211 211 211)   'LightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2869
	(255 182 193)   'LightPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2870
	(255 174 185)   'LightPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2871
	(238 162 173)   'LightPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2872
	(205 140 149)   'LightPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2873
	(139  95 101)   'LightPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2874
	(255 160 122)   'LightSalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2875
	(255 160 122)   'LightSalmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2876
	(238 149 114)   'LightSalmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2877
	(205 129  98)   'LightSalmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2878
	(139  87  66)   'LightSalmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2879
	( 32 178 170)   'LightSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2880
	(135 206 250)   'LightSkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2881
	(176 226 255)   'LightSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2882
	(164 211 238)   'LightSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2883
	(141 182 205)   'LightSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2884
	( 96 123 139)   'LightSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2885
	(132 112 255)   'LightSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2886
	(119 136 153)   'LightSlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2887
	(119 136 153)   'LightSlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2888
	(176 196 222)   'LightSteelBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2889
	(202 225 255)   'LightSteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2890
	(188 210 238)   'LightSteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2891
	(162 181 205)   'LightSteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2892
	(110 123 139)   'LightSteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2893
	(255 255 224)   'LightYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2894
	(255 255 224)   'LightYellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2895
	(238 238 209)   'LightYellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2896
	(205 205 180)   'LightYellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2897
	(139 139 122)   'LightYellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2898
	( 50 205  50)   'lime green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2899
	( 50 205  50)   'LimeGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2900
	(250 240 230)   'linen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2901
	(255   0 255)   'magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2902
	(255   0 255)   'magenta1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2903
	(238   0 238)   'magenta2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2904
	(205   0 205)   'magenta3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2905
	(139   0 139)   'magenta4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2906
	(176  48  96)   'maroon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2907
	(255  52 179)   'maroon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2908
	(238  48 167)   'maroon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2909
	(205  41 144)   'maroon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2910
	(139  28  98)   'maroon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2911
	(102 205 170)   'medium aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2912
	(  0   0 205)   'medium blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2913
	(186  85 211)   'medium orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2914
	(147 112 219)   'medium purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2915
	( 60 179 113)   'medium sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2916
	(123 104 238)   'medium slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2917
	(  0 250 154)   'medium spring green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2918
	( 72 209 204)   'medium turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2919
	(199  21 133)   'medium violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2920
	(102 205 170)   'MediumAquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2921
	(  0   0 205)   'MediumBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2922
	(186  85 211)   'MediumOrchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2923
	(224 102 255)   'MediumOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2924
	(209  95 238)   'MediumOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2925
	(180  82 205)   'MediumOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2926
	(122  55 139)   'MediumOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2927
	(147 112 219)   'MediumPurple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2928
	(171 130 255)   'MediumPurple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2929
	(159 121 238)   'MediumPurple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2930
	(137 104 205)   'MediumPurple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2931
	( 93  71 139)   'MediumPurple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2932
	( 60 179 113)   'MediumSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2933
	(123 104 238)   'MediumSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2934
	(  0 250 154)   'MediumSpringGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2935
	( 72 209 204)   'MediumTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2936
	(199  21 133)   'MediumVioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2937
	( 25  25 112)   'midnight blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2938
	( 25  25 112)   'MidnightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2939
	(245 255 250)   'mint cream'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2940
	(245 255 250)   'MintCream'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2941
	(255 228 225)   'misty rose'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2942
	(255 228 225)   'MistyRose'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2943
	(255 228 225)   'MistyRose1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2944
	(238 213 210)   'MistyRose2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2945
	(205 183 181)   'MistyRose3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2946
	(139 125 123)   'MistyRose4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2947
	(255 228 181)   'moccasin'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2948
	(255 222 173)   'navajo white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2949
	(255 222 173)   'NavajoWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2950
	(255 222 173)   'NavajoWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2951
	(238 207 161)   'NavajoWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2952
	(205 179 139)   'NavajoWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2953
	(139 121  94)   'NavajoWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2954
	(  0   0 128)   'navy'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2955
	(  0   0 128)   'navy blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2956
	(  0   0 128)   'NavyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2957
	(253 245 230)   'old lace'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2958
	(253 245 230)   'OldLace'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2959
	(107 142  35)   'olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2960
	(107 142  35)   'OliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2961
	(192 255  62)   'OliveDrab1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2962
	(179 238  58)   'OliveDrab2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2963
	(154 205  50)   'OliveDrab3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2964
	(105 139  34)   'OliveDrab4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2965
	(255 165   0)   'orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2966
	(255  69   0)   'orange red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2967
	(255 165   0)   'orange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2968
	(238 154   0)   'orange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2969
	(205 133   0)   'orange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2970
	(139  90   0)   'orange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2971
	(255  69   0)   'OrangeRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2972
	(255  69   0)   'OrangeRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2973
	(238  64   0)   'OrangeRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2974
	(205  55   0)   'OrangeRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2975
	(139  37   0)   'OrangeRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2976
	(218 112 214)   'orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2977
	(255 131 250)   'orchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2978
	(238 122 233)   'orchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2979
	(205 105 201)   'orchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2980
	(139  71 137)   'orchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2981
	(238 232 170)   'pale goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2982
	(152 251 152)   'pale green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2983
	(175 238 238)   'pale turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2984
	(219 112 147)   'pale violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2985
	(238 232 170)   'PaleGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2986
	(152 251 152)   'PaleGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2987
	(154 255 154)   'PaleGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2988
	(144 238 144)   'PaleGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2989
	(124 205 124)   'PaleGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2990
	( 84 139  84)   'PaleGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2991
	(175 238 238)   'PaleTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2992
	(187 255 255)   'PaleTurquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2993
	(174 238 238)   'PaleTurquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2994
	(150 205 205)   'PaleTurquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2995
	(102 139 139)   'PaleTurquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2996
	(219 112 147)   'PaleVioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2997
	(255 130 171)   'PaleVioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2998
	(238 121 159)   'PaleVioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2999
	(205 104 137)   'PaleVioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3000
	(139  71  93)   'PaleVioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3001
	(255 239 213)   'papaya whip'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3002
	(255 239 213)   'PapayaWhip'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3003
	(255 218 185)   'peach puff'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3004
	(255 218 185)   'PeachPuff'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3005
	(255 218 185)   'PeachPuff1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3006
	(238 203 173)   'PeachPuff2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3007
	(205 175 149)   'PeachPuff3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3008
	(139 119 101)   'PeachPuff4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3009
	(205 133  63)   'peru'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3010
	(255 192 203)   'pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3011
	(255 181 197)   'pink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3012
	(238 169 184)   'pink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3013
	(205 145 158)   'pink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3014
	(139  99 108)   'pink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3015
	(221 160 221)   'plum'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3016
	(255 187 255)   'plum1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3017
	(238 174 238)   'plum2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3018
	(205 150 205)   'plum3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3019
	(139 102 139)   'plum4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3020
	(176 224 230)   'powder blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3021
	(176 224 230)   'PowderBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3022
	(160  32 240)   'purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3023
	(155  48 255)   'purple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3024
	(145  44 238)   'purple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3025
	(125  38 205)   'purple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3026
	( 85  26 139)   'purple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3027
	(255   0   0)   'red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3028
	(255   0   0)   'red1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3029
	(238   0   0)   'red2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3030
	(205   0   0)   'red3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3031
	(139   0   0)   'red4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3032
	(188 143 143)   'rosy brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3033
	(188 143 143)   'RosyBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3034
	(255 193 193)   'RosyBrown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3035
	(238 180 180)   'RosyBrown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3036
	(205 155 155)   'RosyBrown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3037
	(139 105 105)   'RosyBrown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3038
	( 65 105 225)   'royal blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3039
	( 65 105 225)   'RoyalBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3040
	( 72 118 255)   'RoyalBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3041
	( 67 110 238)   'RoyalBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3042
	( 58  95 205)   'RoyalBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3043
	( 39  64 139)   'RoyalBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3044
	(139  69  19)   'saddle brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3045
	(139  69  19)   'SaddleBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3046
	(250 128 114)   'salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3047
	(255 140 105)   'salmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3048
	(238 130  98)   'salmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3049
	(205 112  84)   'salmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3050
	(139  76  57)   'salmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3051
	(244 164  96)   'sandy brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3052
	(244 164  96)   'SandyBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3053
	( 255 206 137)   'scoActiveBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3054
	( 43  45  49)   'scoActiveForeground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3055
	( 254 222 255)   'scoActiveTopShadow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3056
	( 172 186 204)   'scoAltBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3057
	( 203 203 192)   'scoBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3058
	( 11   0 113)   'scoForeground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3059
	( 141 178 215)   'scoHighlight'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3060
	( 255 240 248)   'scoTopShadow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3061
	( 46 139  87)   'sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3062
	( 46 139  87)   'SeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3063
	( 84 255 159)   'SeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3064
	( 78 238 148)   'SeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3065
	( 67 205 128)   'SeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3066
	( 46 139  87)   'SeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3067
	(255 245 238)   'seashell'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3068
	(255 245 238)   'seashell1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3069
	(238 229 222)   'seashell2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3070
	(205 197 191)   'seashell3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3071
	(139 134 130)   'seashell4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3072
	(142 56 142)   'sgi beet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3073
	(197 193 170)   'sgi bright gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3074
	(197 193 170)   'sgi bright grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3075
	(113 198 113)   'sgi chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3076
	( 85  85  85)   'sgi dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3077
	( 85  85  85)   'sgi dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3078
	(  0   0   0)   'sgi gray 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3079
	(255 255 255)   'sgi gray 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3080
	( 30  30  30)   'sgi gray 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3081
	( 40  40  40)   'sgi gray 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3082
	( 51  51  51)   'sgi gray 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3083
	( 61  61  61)   'sgi gray 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3084
	( 71  71  71)   'sgi gray 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3085
	( 81  81  81)   'sgi gray 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3086
	( 91  91  91)   'sgi gray 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3087
	( 10  10  10)   'sgi gray 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3088
	(102 102 102)   'sgi gray 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3089
	(112 112 112)   'sgi gray 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3090
	(122 122 122)   'sgi gray 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3091
	(132 132 132)   'sgi gray 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3092
	(142 142 142)   'sgi gray 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3093
	(153 153 153)   'sgi gray 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3094
	(163 163 163)   'sgi gray 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3095
	(173 173 173)   'sgi gray 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3096
	(183 183 183)   'sgi gray 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3097
	(193 193 193)   'sgi gray 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3098
	( 20  20  20)   'sgi gray 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3099
	(204 204 204)   'sgi gray 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3100
	(214 214 214)   'sgi gray 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3101
	(224 224 224)   'sgi gray 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3102
	(234 234 234)   'sgi gray 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3103
	(244 244 244)   'sgi gray 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3104
	(  0   0   0)   'sgi grey 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3105
	(255 255 255)   'sgi grey 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3106
	( 30  30  30)   'sgi grey 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3107
	( 40  40  40)   'sgi grey 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3108
	( 51  51  51)   'sgi grey 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3109
	( 61  61  61)   'sgi grey 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3110
	( 71  71  71)   'sgi grey 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3111
	( 81  81  81)   'sgi grey 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3112
	( 91  91  91)   'sgi grey 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3113
	( 10  10  10)   'sgi grey 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3114
	(102 102 102)   'sgi grey 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3115
	(112 112 112)   'sgi grey 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3116
	(122 122 122)   'sgi grey 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3117
	(132 132 132)   'sgi grey 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3118
	(142 142 142)   'sgi grey 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3119
	(153 153 153)   'sgi grey 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3120
	(163 163 163)   'sgi grey 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3121
	(173 173 173)   'sgi grey 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3122
	(183 183 183)   'sgi grey 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3123
	(193 193 193)   'sgi grey 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3124
	( 20  20  20)   'sgi grey 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3125
	(204 204 204)   'sgi grey 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3126
	(214 214 214)   'sgi grey 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3127
	(224 224 224)   'sgi grey 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3128
	(234 234 234)   'sgi grey 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3129
	(244 244 244)   'sgi grey 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3130
	(125 158 192)   'sgi light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3131
	(170 170 170)   'sgi light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3132
	(170 170 170)   'sgi light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3133
	(132 132 132)   'sgi medium gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3134
	(132 132 132)   'sgi medium grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3135
	(142 142  56)   'sgi olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3136
	(198 113 113)   'sgi salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3137
	(113 113 198)   'sgi slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3138
	( 56 142 142)   'sgi teal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3139
	( 40  40  40)   'sgi very dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3140
	( 40  40  40)   'sgi very dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3141
	(214 214 214)   'sgi very light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3142
	(214 214 214)   'sgi very light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3143
	(142 56 142)   'SGIBeet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3144
	(197 193 170)   'SGIBrightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3145
	(197 193 170)   'SGIBrightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3146
	(113 198 113)   'SGIChartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3147
	( 85  85  85)   'SGIDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3148
	( 85  85  85)   'SGIDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3149
	(  0   0   0)   'SGIGray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3150
	(255 255 255)   'SGIGray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3151
	( 30  30  30)   'SGIGray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3152
	( 40  40  40)   'SGIGray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3153
	( 51  51  51)   'SGIGray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3154
	( 61  61  61)   'SGIGray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3155
	( 71  71  71)   'SGIGray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3156
	( 81  81  81)   'SGIGray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3157
	( 91  91  91)   'SGIGray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3158
	( 10  10  10)   'SGIGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3159
	(102 102 102)   'SGIGray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3160
	(112 112 112)   'SGIGray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3161
	(122 122 122)   'SGIGray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3162
	(132 132 132)   'SGIGray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3163
	(142 142 142)   'SGIGray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3164
	(153 153 153)   'SGIGray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3165
	(163 163 163)   'SGIGray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3166
	(173 173 173)   'SGIGray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3167
	(183 183 183)   'SGIGray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3168
	(193 193 193)   'SGIGray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3169
	( 20  20  20)   'SGIGray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3170
	(204 204 204)   'SGIGray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3171
	(214 214 214)   'SGIGray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3172
	(224 224 224)   'SGIGray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3173
	(234 234 234)   'SGIGray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3174
	(244 244 244)   'SGIGray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3175
	(  0   0   0)   'SGIGrey0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3176
	(255 255 255)   'SGIGrey100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3177
	( 30  30  30)   'SGIGrey12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3178
	( 40  40  40)   'SGIGrey16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3179
	( 51  51  51)   'SGIGrey20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3180
	( 61  61  61)   'SGIGrey24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3181
	( 71  71  71)   'SGIGrey28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3182
	( 81  81  81)   'SGIGrey32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3183
	( 91  91  91)   'SGIGrey36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3184
	( 10  10  10)   'SGIGrey4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3185
	(102 102 102)   'SGIGrey40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3186
	(112 112 112)   'SGIGrey44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3187
	(122 122 122)   'SGIGrey48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3188
	(132 132 132)   'SGIGrey52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3189
	(142 142 142)   'SGIGrey56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3190
	(153 153 153)   'SGIGrey60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3191
	(163 163 163)   'SGIGrey64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3192
	(173 173 173)   'SGIGrey68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3193
	(183 183 183)   'SGIGrey72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3194
	(193 193 193)   'SGIGrey76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3195
	( 20  20  20)   'SGIGrey8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3196
	(204 204 204)   'SGIGrey80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3197
	(214 214 214)   'SGIGrey84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3198
	(224 224 224)   'SGIGrey88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3199
	(234 234 234)   'SGIGrey92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3200
	(244 244 244)   'SGIGrey96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3201
	(125 158 192)   'SGILightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3202
	(170 170 170)   'SGILightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3203
	(170 170 170)   'SGILightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3204
	(132 132 132)   'SGIMediumGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3205
	(132 132 132)   'SGIMediumGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3206
	(142 142  56)   'SGIOliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3207
	(198 113 113)   'SGISalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3208
	(113 113 198)   'SGISlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3209
	( 56 142 142)   'SGITeal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3210
	( 40  40  40)   'SGIVeryDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3211
	( 40  40  40)   'SGIVeryDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3212
	(214 214 214)   'SGIVeryLightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3213
	(214 214 214)   'SGIVeryLightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3214
	(160  82  45)   'sienna'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3215
	(255 130  71)   'sienna1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3216
	(238 121  66)   'sienna2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3217
	(205 104  57)   'sienna3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3218
	(139  71  38)   'sienna4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3219
	(135 206 235)   'sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3220
	(135 206 235)   'SkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3221
	(135 206 255)   'SkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3222
	(126 192 238)   'SkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3223
	(108 166 205)   'SkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3224
	( 74 112 139)   'SkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3225
	(106  90 205)   'slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3226
	(112 128 144)   'slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3227
	(112 128 144)   'slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3228
	(106  90 205)   'SlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3229
	(131 111 255)   'SlateBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3230
	(122 103 238)   'SlateBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3231
	(105  89 205)   'SlateBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3232
	( 71  60 139)   'SlateBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3233
	(112 128 144)   'SlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3234
	(198 226 255)   'SlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3235
	(185 211 238)   'SlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3236
	(159 182 205)   'SlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3237
	(108 123 139)   'SlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3238
	(112 128 144)   'SlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3239
	(255 250 250)   'snow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3240
	(255 250 250)   'snow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3241
	(238 233 233)   'snow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3242
	(205 201 201)   'snow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3243
	(139 137 137)   'snow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3244
	(  0 255 127)   'spring green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3245
	(  0 255 127)   'SpringGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3246
	(  0 255 127)   'SpringGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3247
	(  0 238 118)   'SpringGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3248
	(  0 205 102)   'SpringGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3249
	(  0 139  69)   'SpringGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3250
	( 70 130 180)   'steel blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3251
	( 70 130 180)   'SteelBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3252
	( 99 184 255)   'SteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3253
	( 92 172 238)   'SteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3254
	( 79 148 205)   'SteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3255
	( 54 100 139)   'SteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3256
	(210 180 140)   'tan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3257
	(255 165  79)   'tan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3258
	(238 154  73)   'tan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3259
	(205 133  63)   'tan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3260
	(139  90  43)   'tan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3261
	(216 191 216)   'thistle'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3262
	(255 225 255)   'thistle1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3263
	(238 210 238)   'thistle2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3264
	(205 181 205)   'thistle3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3265
	(139 123 139)   'thistle4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3266
	(255  99  71)   'tomato'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3267
	(255  99  71)   'tomato1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3268
	(238  92  66)   'tomato2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3269
	(205  79  57)   'tomato3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3270
	(139  54  38)   'tomato4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3271
	( 64 224 208)   'turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3272
	(  0 245 255)   'turquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3273
	(  0 229 238)   'turquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3274
	(  0 197 205)   'turquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3275
	(  0 134 139)   'turquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3276
	(238 130 238)   'violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3277
	(208  32 144)   'violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3278
	(208  32 144)   'VioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3279
	(255  62 150)   'VioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3280
	(238  58 140)   'VioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3281
	(205  50 120)   'VioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3282
	(139  34  82)   'VioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3283
	(245 222 179)   'wheat'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3284
	(255 231 186)   'wheat1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3285
	(238 216 174)   'wheat2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3286
	(205 186 150)   'wheat3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3287
	(139 126 102)   'wheat4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3288
	(255 255 255)   'white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3289
	(245 245 245)   'white smoke'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3290
	(245 245 245)   'WhiteSmoke'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3291
	(255 255   0)   'yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3292
	(154 205  50)   'yellow green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3293
	(255 255   0)   'yellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3294
	(238 238   0)   'yellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3295
	(205 205   0)   'yellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3296
	(139 139   0)   'yellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3297
	(154 205  50)   'YellowGreen'   
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3298
    ) pairWiseDo:[ :value :name |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3299
	StandardColorValues at:name put:value
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3300
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3301
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3302
     WinWorkstation initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3303
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3304
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3305
2232
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
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3308
nativeWindows:aBoolean
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3309
    "enable / disable use of native windows"
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3310
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3311
    NativeWindows := aBoolean
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3312
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3313
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3314
!WinWorkstation class methodsFor:'debugging'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3315
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3316
debug:aBoolean
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3317
    "enable/disable debug prints - this will vanish"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3318
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3319
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3320
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3321
    __debug__ = (aBoolean == true) ? 1 : 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3322
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3323
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3324
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3325
prim
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3326
   "show prim values"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3327
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3328
   ('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
  3329
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3330
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3331
primBitmaps
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3332
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3333
    RETURN ( __MKSMALLINT(__cnt_bitmap));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3334
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3335
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3336
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3337
primBmpDc
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3338
%{  /* NOCONTEXT */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3339
    RETURN ( __MKSMALLINT(__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3340
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3341
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3342
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3343
primWindows
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3344
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3345
    RETURN ( __MKSMALLINT(__cnt_createWindows));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3346
%}
2232
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
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3349
primgcData
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3350
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3351
    RETURN ( __MKSMALLINT(__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3352
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3353
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3354
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3355
!WinWorkstation class methodsFor:'queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3356
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3357
getSystemMetrics:aSymbol
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3358
    "get a system metrics value"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3359
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3360
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3361
    int info = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3362
    int isBool = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3363
    int arg;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3364
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3365
    if ((aSymbol == @symbol(swapButton))
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3366
    || (aSymbol == @symbol(SM_SWAPBUTTON))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3367
	arg = SM_SWAPBUTTON;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3368
	isBool = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3369
    } else if (aSymbol == @symbol(mouseButtons)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3370
	arg = SM_CMOUSEBUTTONS;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3371
    } else if ((aSymbol == @symbol(iconWidth)) || (aSymbol == @symbol(SM_CXICON))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3372
	arg = SM_CXICON;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3373
    } else if ((aSymbol == @symbol(iconHeight)) || (aSymbol == @symbol(SM_CYICON))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3374
	arg = SM_CYICON;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3375
    } else if ((aSymbol == @symbol(cursorWidth)) || (aSymbol == @symbol(SM_CXCURSOR))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3376
	arg = SM_CXCURSOR;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3377
    } else if ((aSymbol == @symbol(cursorHeight)) || (aSymbol == @symbol(SM_CYCURSOR))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3378
	arg = SM_CYCURSOR;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3379
    } else if ((aSymbol == @symbol(captionHeight)) || (aSymbol == @symbol(SM_CYCAPTION))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3380
	arg = SM_CYCAPTION;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3381
    } else if ((aSymbol == @symbol(resizeFrameWidth)) || (aSymbol == @symbol(SM_CXFRAME))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3382
	arg = SM_CXFRAME;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3383
    } else if ((aSymbol == @symbol(resizeFrameHeight)) || (aSymbol == @symbol(SM_CYFRAME))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3384
	arg = SM_CYFRAME;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3385
    } else if ((aSymbol == @symbol(borderFrameWidth)) || (aSymbol == @symbol(SM_CXBORDER))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3386
	arg = SM_CXBORDER;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3387
    } else if ((aSymbol == @symbol(borderFrameHeight)) || (aSymbol == @symbol(SM_CYBORDER))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3388
	arg = SM_CYBORDER;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3389
    } else if ((aSymbol == @symbol(fullScreenWindowWidth)) || (aSymbol == @symbol(SM_CXFULLSCREEN))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3390
	arg = SM_CXFULLSCREEN;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3391
    } else if ((aSymbol == @symbol(fullScreenWindowHeight)) || (aSymbol == @symbol(SM_CYFULLSCREEN))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3392
	arg = SM_CYFULLSCREEN;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3393
    } else if ((aSymbol == @symbol(vScrollbarWidth)) || (aSymbol == @symbol(SM_CXVSCROLL))) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3394
	arg = SM_CXVSCROLL;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3395
    } else if ((aSymbol == @symbol(hScrollbarHeight)) || (aSymbol == @symbol(SM_CYHSCROLL))) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3396
	arg = SM_CYHSCROLL;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3397
    } else if ((aSymbol == @symbol(vThumbHeight)) || (aSymbol == @symbol(SM_CYVTHUMB))) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3398
	arg = SM_CYVTHUMB;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3399
    } else if ((aSymbol == @symbol(hThumbWidth)) || (aSymbol == @symbol(SM_CXHTHUMB))) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3400
	arg = SM_CXHTHUMB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3401
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3402
	RETURN (nil);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3403
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3404
    info = GetSystemMetrics(arg);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3405
    if (isBool) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3406
	RETURN (info ? true : false);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3407
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3408
    RETURN (__MKSMALLINT(info));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3409
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3410
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3411
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3412
platformName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3413
    "ST-80 compatibility.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3414
     Return a string describing the display systems platform."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3415
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3416
    ^ 'WIN32'  
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3417
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3418
    "Modified: 26.5.1996 / 15:32:46 / cg"
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3421
!WinWorkstation methodsFor:'accessing & queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3422
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3423
anyButtonMotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3424
    "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
  3425
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3426
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3427
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3428
    RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3429
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3430
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3431
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3432
blackpixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3433
    "return the colornumber of black"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3434
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3435
    ^ blackpixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3436
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3437
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3438
button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3439
    "return the state-mask for button1 in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3440
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3441
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3442
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3443
    RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3444
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3445
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
     Display button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3448
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3449
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3450
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3451
button2MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3452
    "return the state-mask for button2 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3453
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3454
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3455
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3456
    RETURN (__MKSMALLINT(Button2MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3457
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3458
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3459
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3460
button3MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3461
    "return the state-mask for button3 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3462
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3463
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3464
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3465
    RETURN (__MKSMALLINT(Button3MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3466
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3467
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3468
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3469
buttonMotionMask:aButton
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3470
    "return the state-mask for button1 in motion events state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3471
     This is the devices mask."
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
    if (aButton == __MKSMALLINT(1)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3475
	RETURN (__MKSMALLINT(Button1MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3476
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3477
    if (aButton == __MKSMALLINT(2)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3478
	RETURN (__MKSMALLINT(Button2MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3479
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3480
    if (aButton == __MKSMALLINT(3)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3481
	RETURN (__MKSMALLINT(Button3MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3482
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3483
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3484
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3485
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3486
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3487
controlMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3488
    "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
  3489
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3490
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3491
    RETURN (__MKSMALLINT(ControlMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3492
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3493
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3494
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3495
defaultEventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3496
    "return a mask to enable some events by default."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3497
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3498
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3499
    RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3500
			 KeyPressMask | KeyReleaseMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3501
			 EnterWindowMask | LeaveWindowMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3502
			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3503
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3504
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3505
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3506
displayFileDescriptor
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3507
    "return the displays fileNumber for select, if any"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3508
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3509
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3510
   /* RETURN (nil);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3511
   RETURN ( __MKEXTERNALADDRESS(hInputEvent));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3512
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3513
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3514
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3515
displayName
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3516
    "return the display-connections display name.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3517
     For Windows, a dummy name is returned"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3518
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3519
    ^ 'local'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3520
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3521
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3522
getSystemColor:aKey
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3523
    "retrieve a windows system color.
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3524
     The styleSheet/View classes may use this to setup default colors"
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3525
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3526
    |rgb|
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3527
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3528
    rgb := self primGetSystemColor:aKey.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3529
    rgb notNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3530
	^ Color
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3531
	    redByte:((rgb bitShift:-16) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3532
	    greenByte:((rgb bitShift:-8) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3533
	    blueByte:(rgb bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3534
    ].
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3535
    ^ nil
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3536
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3537
    "
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3538
     Display getSystemColor:#COLOR_WINDOW
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3539
     Display getSystemColor:#COLOR_HIGHLIGHT
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3540
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3541
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3542
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3543
primGetSystemColor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3544
%{  /* xxLIMITEDSTACK (WIN95 only) */
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3545
    int p;
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3546
    int rgb, r, g, b;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3547
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3548
    if (aKey == @symbol(COLOR_WINDOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3549
      p = COLOR_WINDOW;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3550
    } else if (aKey == @symbol(COLOR_WINDOWTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3551
      p = COLOR_WINDOWTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3552
    } else if (aKey == @symbol(COLOR_MENU)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3553
      p = COLOR_MENU;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3554
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3555
      p = COLOR_MENUTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3556
    } else if (aKey == @symbol(COLOR_BTNFACE)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3557
      p = COLOR_BTNFACE;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3558
    } else if (aKey == @symbol(COLOR_BTNSHADOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3559
      p = COLOR_BTNSHADOW;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3560
    } else if (aKey == @symbol(COLOR_BTNTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3561
      p = COLOR_BTNTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3562
    } else if (aKey == @symbol(COLOR_GRAYTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3563
      p = COLOR_GRAYTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3564
    } else if (aKey == @symbol(COLOR_HIGHLIGHT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3565
      p = COLOR_HIGHLIGHT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3566
    } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3567
      p = COLOR_HIGHLIGHTTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3568
    } else if (aKey == @symbol(COLOR_MENU)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3569
      p = COLOR_MENU;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3570
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3571
      p = COLOR_MENUTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3572
    } else if (aKey == @symbol(COLOR_SCROLLBAR)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3573
      p = COLOR_SCROLLBAR;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  3574
#ifdef COLOR_SHADOW
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3575
    } else if (aKey == @symbol(COLOR_SHADOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3576
      p = COLOR_SHADOW;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  3577
#endif
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3578
    } else {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3579
      RETURN (nil);
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3580
    }
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3581
    rgb = GetSysColor(p);
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3582
    /* win uses BGR order */
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3583
    r = rgb & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3584
    g = (rgb >> 8) & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3585
    b = (rgb >> 16) & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3586
    rgb = (((r << 8) | g) << 8) | b;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3587
    RETURN (__MKSMALLINT(rgb));
2000
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
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3590
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3591
primTranslatePointX:x y:y from:windowId1 to:windowId2
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3592
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3593
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3594
    HWND w1, w2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3595
    POINT point;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3596
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3597
    if (__isExternalAddress(windowId1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3598
     && __isExternalAddress(windowId2)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3599
     && __bothSmallInteger(x, y)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3600
	w1 = _HWNDVal(windowId1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3601
	w2 = _HWNDVal(windowId2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3602
	point.x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3603
	point.y = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3604
	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
  3605
	ClientToScreen(w1,&point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3606
	ScreenToClient(w2,&point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3607
	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
  3608
	RETURN (__MKPOINT_INT(point.x, point.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3609
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3610
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3611
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3612
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3613
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3614
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3615
primViewIdFromPoint:aPoint in:windowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3616
    "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
  3617
     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
  3618
     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
  3619
     - 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
  3620
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3621
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3622
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3623
    OBJ xp, yp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3624
    int xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3625
    HWND child_return;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3626
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3627
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3628
     && __isExternalAddress(windowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3629
     && __isPoint(aPoint))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3630
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3631
	xp = _point_X(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3632
	yp = _point_Y(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3633
	if (__bothSmallInteger(xp, yp))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3634
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3635
	    POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3636
	    HWND hWnd = _HWNDVal(windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3637
	    p.x = __intVal(xp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3638
	    p.y = __intVal(yp);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3639
	    ScreenToClient(hWnd, &p);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3640
	    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
  3641
	    /*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
  3642
	    if ((child_return) && (child_return != hWnd))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3643
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3644
		RETURN ( __MKEXTERNALADDRESS(child_return) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3645
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3646
	    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3647
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3648
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3649
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3650
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3651
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3652
protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3653
    "return the displays protocol version.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3654
     For Windows, a dummy number is returned"
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
    ^ '1'
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
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3659
     Display protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3660
    "
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
serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3664
    "return the server vendor string. 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3665
     For Windows, a dummy name is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3666
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3667
    ^ 'microsoft'
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
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3670
     Display serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3671
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3672
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3673
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3674
shiftMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3675
    "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
  3676
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3677
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3678
    RETURN (__MKSMALLINT(ShiftMask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3679
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3680
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3681
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3682
translatePoint:aPoint from:windowId1 to:windowId2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3683
    "given a point in window1, return the coordinate in window2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3684
     This expects a device coordinate (relative to the first views origin)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3685
     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
  3686
     - use to xlate points from a window to rootwindow"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3687
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3688
    |x1 y1 x2 y2|
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3689
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3690
    x1 := x2 := aPoint x truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3691
    y1 := y2 := aPoint y truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3692
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3693
%{
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3694
    HWND w1, w2;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3695
    POINT point;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3696
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3697
    if (__isExternalAddress(windowId1)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3698
     && __isExternalAddress(windowId2)
2279
30a35be06995 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2276
diff changeset
  3699
     && __bothSmallInteger(x1, y1)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3700
	w1 = _HWNDVal(windowId1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3701
	w2 = _HWNDVal(windowId2);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3702
	point.x = __intVal(x1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3703
	point.y = __intVal(y1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3704
	DPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y));
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3705
	ClientToScreen(w1,&point);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3706
	ScreenToClient(w2,&point);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3707
	DPRINTF((" %x %d/%d\n",w2,point.x,point.y));
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3708
	x2 = __MKSMALLINT(point.x);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3709
	y2 = __MKSMALLINT(point.y);
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3710
    }
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3711
%}.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3712
    ^ (x2 @ y2)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3713
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3714
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3715
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3716
vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3717
    "return the display-servers vendor release 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3718
     - should normally not be of any interest, 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3719
     but may be usefule for special cases.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3720
     (to avoid bugs in certain implementations / releases)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3721
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3722
    ^ 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3723
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3724
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3725
     Display vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3726
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3727
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3728
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3729
viewIdFromPoint:aPoint in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3730
    "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
  3731
     hit by this coordinate. Return nil if no view was hit.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3732
     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
  3733
     - 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
  3734
     
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3735
    windowId notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3736
	aPoint isPoint ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3737
	    "/(aPoint x > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3738
	    "/(aPoint y > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3739
	    "/aPoint printString errorPrintCR.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3740
	    ^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3741
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3742
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3743
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3744
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3745
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3746
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3747
whitepixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3748
    "return the colornumber of white"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3749
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3750
    ^ whitepixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3751
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3752
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3753
!WinWorkstation methodsFor:'accessing display capabilities'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3754
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3755
captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3756
    "return the height in pixels of any caption (title-bar) in
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3757
     standard topWindows."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3758
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3759
    ^ self class getSystemMetrics:#captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3760
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3761
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3762
iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3763
    "Get the preferred/supported icon sizes."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3764
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3765
    |d w h|
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3766
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3767
    w := self class getSystemMetrics:#iconWidth.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3768
    h := self class getSystemMetrics:#iconHeight.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3769
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3770
    d := IdentityDictionary new.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3771
    d at:#minWidth put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3772
    d at:#maxWidth put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3773
    d at:#widthStep put:1.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3774
    d at:#minHeight put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3775
    d at:#maxHeight put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3776
    d at:#heightStep put:1.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3777
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3778
    ^ OrderedCollection with:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3779
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3780
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3781
     Display iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3782
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3783
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3784
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3785
scrollsAsynchronous
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3786
    "return true, if this display asynchronously sends expose events after a
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3787
     scroll operation. False otherwise. Asynchronous expose events are an X
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3788
     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
  3789
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3790
    "/ event Handling erst verbessern 
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3791
    ^ true "/ false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3792
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3793
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3794
supportedImageFormats
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3795
    "return an array with supported image formats; each array entry
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3796
     is another array, consisting of depth and bitsPerPixel values."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3797
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3798
    |info|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3799
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3800
    info := IdentityDictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3801
    info at:#depth put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3802
    info at:#bitsPerPixel put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3803
    info at:#padding put:32.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3804
    ^ Array with:info
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3805
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3806
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3807
supportsDeepIcons
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3808
    "return true, if this device supports deepicons."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3809
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3810
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3811
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3812
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3813
supportsIconViews
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3814
    "return true, if this device supports views as icons."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3815
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3816
    ^ false "/ true
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3817
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3818
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3819
     Display supportsIconViews
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3820
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3821
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3822
    "Modified: 10.6.1996 / 20:11:48 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3823
    "Created: 10.6.1996 / 21:08:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3824
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3825
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3826
usableExtent
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3827
    "return the usable extent of the display (in pixels).
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3828
     Normally, the same as extent, but may be smaller, in
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3829
     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
  3830
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3831
    ^ (self class getSystemMetrics:#fullScreenWindowWidth)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3832
      @
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3833
      (self class getSystemMetrics:#fullScreenWindowHeight)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3834
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3835
    "
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3836
     Display usableExtent
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3837
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3838
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3839
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3840
!WinWorkstation methodsFor:'bitmap/window creation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3841
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3842
createBitmapFromArray:anArray width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3843
    |bitmapId|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3844
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3845
    bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3846
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3847
    bitmapId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3848
	'WINWORKSTATION: cannot create bitmap' errorPrintCR.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3849
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3850
    ^ bitmapId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3851
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3852
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3853
createBitmapWidth:w height:h
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3854
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3855
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3856
    HANDLE newBitmapHandle;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3857
    int b_width, b_height;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3858
/*    printf("CreateBitmap B/W\n");*/
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3859
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3860
    if (__bothSmallInteger(w, h)) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3861
	b_width = __intVal(w);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3862
	b_height = __intVal(h);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3863
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3864
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3865
	if (newBitmapHandle)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3866
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3867
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3868
	    __cnt_bitmap++;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3869
	   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
  3870
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3871
	  RETURN ( __MKOBJ(newBitmapHandle));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3872
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3873
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3874
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3875
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3876
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3877
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3878
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3879
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3880
createPixmapWidth:w height:h depth:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3881
    "allocate a pixmap on the Xserver, the contents is undefined
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3882
     (i.e. random). Return a bitmap id or nil"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3883
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3884
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3885
    HANDLE newBitmapHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3886
    /*printf("CreateBitmap Color\n");*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3887
    if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3888
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3889
	if (__intVal(d) == 1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3890
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3891
	  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
  3892
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3893
	else
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3894
	{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3895
	  /*if (__intVal(d) != __depth)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3896
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3897
	    printf("invalite depth\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3898
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3899
	  } */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3900
	  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
  3901
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3902
	if (newBitmapHandle)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3903
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3904
#ifdef COUNT_BMP_RESOURCES
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3905
	    __cnt_bitmap++;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3906
	   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
  3907
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3908
	  RETURN ( __MKOBJ(newBitmapHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3909
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3910
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3911
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3912
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3913
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3914
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3915
1467
9629ce710c53 added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3916
createWindowFor:aView type:typeSymbol
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3917
		 origin:origin
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3918
		 extent:extent
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3919
		 minExtent:minExt
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3920
		 maxExtent:maxExt
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3921
		 borderWidth:bWidth
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3922
		 subViewOf:wsuperView
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3923
		 style:wStyle
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3924
		 inputOnly:winputOnly
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3925
		 label:wlabel
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3926
		 owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3927
		 icon:wicon
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3928
		 iconMask:wiconMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3929
		 iconView:wiconView
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3930
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3931
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3932
    |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3933
     wsuperViewId wiconId wiconMaskId windowId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3934
     weventMask wiconHeight
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3935
     wiconWidth windowType windowClass moreArgs|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3936
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3937
    "/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3938
    "/  preferredVisual preferredDepth  viewGravity wcursorId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3939
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3940
    displayId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3941
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3942
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3943
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3944
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3945
    origin notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3946
	xpos := origin x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3947
	ypos := origin y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3948
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3949
	xpos := ypos := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3950
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3951
    extent notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3952
	wwidth := extent x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3953
	wheight := extent y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3954
    ] ifFalse:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3955
	wwidth := 100.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3956
	wheight := 40.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3957
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3958
    minExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3959
	minWidth := minExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3960
	minHeight := minExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3961
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3962
    maxExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3963
	maxWidth := maxExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3964
	maxHeight := maxExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3965
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3966
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3967
    wsuperView notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3968
	wsuperViewId := wsuperView id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3969
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3970
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3971
    wicon notNil ifTrue:[
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3972
	wiconId := wicon id.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3973
	wiconHeight := wicon height.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3974
	wiconWidth  := wicon width.
1418
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  3975
	wiconMask notNil ifTrue:[
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  3976
	    wiconMaskId := wiconMask id
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  3977
	]
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3978
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3979
"/    wiconView notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3980
"/        wiconViewId := wiconView id
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3981
"/    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3982
    weventMask := aView eventMask.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3983
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3984
    NativeWindows ifTrue:[
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3985
	windowType := aView nativeWindowType.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3986
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3987
	"/ if it is already a string, take it as it is;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3988
	"/ otherwise, it must be a symbol and is used
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3989
	"/ as a key into the nativeClass translation map.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3990
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3991
	windowType isString ifTrue:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3992
	    windowClass := windowType
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3993
	] ifFalse:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3994
	    windowClass := NativeWindowClassTable at:windowType ifAbsent:nil
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3995
	]
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3996
    ].
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3997
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3998
    moreArgs := Array new:20.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3999
    moreArgs at:1 put:xpos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4000
    moreArgs at:2 put:ypos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4001
    moreArgs at:3 put:wwidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4002
    moreArgs at:4 put:wheight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4003
    moreArgs at:5 put:minWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4004
    moreArgs at:6 put:minHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4005
    moreArgs at:7 put:maxWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4006
    moreArgs at:8 put:maxHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4007
    moreArgs at:9 put:wsuperViewId.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4008
    moreArgs at:10 put:nil. "/ wcursorId.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4009
    moreArgs at:11 put:wiconId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4010
    moreArgs at:12 put:wiconMaskId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4011
    moreArgs at:13 put:wiconWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4012
    moreArgs at:14 put:wiconHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4013
    moreArgs at:15 put:windowType.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4014
    moreArgs at:16 put:windowClass.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4015
    moreArgs at:17 put:weventMask.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4016
    moreArgs at:18 put:(aView className asString).
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4017
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4018
    [
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4019
      windowId := self
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4020
		  primCreateWindowFor:aView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4021
		  type:typeSymbol
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4022
		  borderWidth:bWidth
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4023
		  subViewOf:wsuperView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4024
		  style:wStyle
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4025
		  inputOnly:winputOnly
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4026
		  label:wlabel
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4027
		  owner:wowner
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4028
		  icon:wicon
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4029
		  iconMask:wiconMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4030
		  moreArgs:moreArgs.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4031
      aView setId:windowId.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4032
    ] valueUninterruptably.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4033
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4034
    windowId notNil ifTrue:[self addKnownView:aView withId:windowId].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4035
    ^ windowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4036
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4037
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4038
destroyGC:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4039
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4040
    if (__isExternalAddress(aGCId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4041
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4042
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4043
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4044
	__cnt_gcData--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4045
       RESPRINTF(("DestroyGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4046
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4047
       if (gcData->hBitmap) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4048
       {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4049
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4050
	    __cnt_bmpdc--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4051
	    RES_BMP_PRINTF(("free BmpDC %d\n",__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4052
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4053
       }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4054
       if (lastGcData == gcData)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4055
       {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4056
	 _releaseDC(lastGcData);
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4057
	 lastGcData = 0;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4058
       }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4059
       free(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4060
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4061
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4062
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4063
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4064
destroyPixmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4065
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4066
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4067
    if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4068
	HANDLE bitmapHandle = _HANDLEVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4069
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4070
	if (bitmapHandle)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4071
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4072
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4073
	    __cnt_bitmap--;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4074
	    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
  4075
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4076
	    if( DelObject(bitmapHandle) )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4077
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4078
		DPRINTF(("Bitmap deleted!\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4079
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4080
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4081
    }
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
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4084
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4085
destroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4086
    self primDestroyView:aView withId:aWindowId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4087
    self removeKnownView:aView withId:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4088
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4089
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4090
gcFor:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4091
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4092
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4093
    HWND hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4094
    struct gcData *gcData;
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 (__isExternalAddress(aDrawableId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4097
	hWnd = _HWNDVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4098
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4099
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4100
	    RETURN (nil);
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
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4103
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4104
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4105
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4106
	gcData->hWnd = hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4107
	gcData->_hDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4108
	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
  4109
	RETURN ( __MKOBJ(gcData) );
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
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4112
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4113
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4114
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4115
gcForBitmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4116
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4117
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4118
    struct gcData *gcData;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4119
    BITMAP bitmap;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4120
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4121
    if (__isExternalAddress(aDrawableId)) {  /* HBITMAP */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4122
	HBITMAP hBitmap = _HBITMAPVAL(aDrawableId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4123
	HDC hDC;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4124
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4125
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4126
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4127
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4128
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4129
	__cnt_bmpdc++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4130
	RES_BMP_PRINTF(("CreateBmpDC %d\n",__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4131
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4132
	if (GetObject(hBitmap,sizeof(bitmap),&bitmap))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4133
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4134
	    DPRINTF(("bitmap info:%d\n",bitmap.bmBitsPixel));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4135
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4136
	else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4137
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4138
	    DPRINTF(("noinfo returned\n"));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4139
	}
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4140
	gcData->hBitmap = hBitmap;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4141
	gcData->bitmapColorBitCount = bitmap.bmBitsPixel;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4142
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4143
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4144
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4145
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4146
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4147
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4148
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4149
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4150
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4151
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4152
primCreateBitmapFromArray:anArray width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4153
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4154
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4155
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4156
    HBITMAP newBitmapHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4157
    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
  4158
    int row, col;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4159
    unsigned char *cp, *bPits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4160
    unsigned char *b_bits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4161
    unsigned char *pBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4162
    int index;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4163
    OBJ num, *op;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4164
    unsigned char *allocatedBits = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4165
    unsigned char fastBits[10000];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4166
/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4167
    if (! ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4168
	RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4169
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4170
*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4171
    if (__bothSmallInteger(w, h) && _isNonNilObject(anArray))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4172
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4173
	b_width = __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4174
	b_height = __intVal(h);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4175
	bytesPerRowST = (b_width + 7) / 8;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4176
	bytesPerRowWN = ((b_width + 15) / 16) * 2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4177
	padding = bytesPerRowWN - bytesPerRowST;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4178
	nBytes = b_height * bytesPerRowWN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4179
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4180
	if (nBytes < sizeof(fastBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4181
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4182
	    cp = b_bits = fastBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4183
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4184
	else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4185
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4186
	    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4187
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4188
	if (cp)
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
	  if (__qClass(anArray) == @global(Array))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4191
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4192
	      index = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4193
	      op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4194
	      for (row = b_height; row; row--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4195
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4196
		  for (col = bytesPerRowST; col; col--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4197
		  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4198
		      num = *op++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4199
		      if (! __isSmallInteger(num))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4200
			goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4201
		      *cp++ = __intVal(num);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4202
		  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4203
		  cp += padding;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4204
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4205
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4206
	  else if (__qClass(anArray) == @global(ByteArray))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4207
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4208
	      pBits = __ByteArrayInstPtr(anArray)->ba_element;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4209
	      for (row = b_height; row; row--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4210
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4211
		  for (col = bytesPerRowST; col; col--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4212
		  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4213
		      *cp++ = ( *pBits++ /*^ 0xFF*/ );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4214
		  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4215
		  cp += padding;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4216
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4217
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4218
	  else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4219
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4220
	      goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4221
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4222
	  DPRINTF(("create bitmap ...\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4223
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4224
	  newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, b_bits );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4225
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4226
	  if( newBitmapHandle )
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4227
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4228
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4229
	    __cnt_bitmap++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4230
	    RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle,__cnt_bitmap));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4231
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4232
	    DPRINTF(("returning bitmap ...\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4233
	    if (allocatedBits)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4234
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4235
	      free(allocatedBits);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4236
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4237
	    RETURN ( __MKOBJ(newBitmapHandle));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4238
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4239
      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4240
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4241
fail: ;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4242
    PRINTF(("create bitmap FAILED!!!\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4243
    if (allocatedBits)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4244
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4245
      PRINTF(("freeing up bitmap bits ...\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4246
      free(allocatedBits);
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
    DPRINTF(("returning nil ...\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4249
    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4250
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4251
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4252
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4253
primCreateWindowFor:aView type:aSymbol
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4254
	  borderWidth:bWidth subViewOf:wsuperView
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4255
	  style:wStyle inputOnly:winputOnly
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4256
	  label:wlabel owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4257
	  icon:wicon iconMask:wiconMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4258
	  moreArgs:moreArgs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4259
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4260
%{  /* xxLIMITEDSTACK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4261
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4262
    WNDCLASS wc;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4263
    long bg, bd, bw;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  4264
    int winStyleBits, winEXStyleBits;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4265
    int w, h, x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4266
    int min_width, min_height;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4267
    int max_width, max_height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4268
    OBJ eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4269
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4270
    HANDLE parentHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4271
    OBJ xpos, ypos, wwidth, wheight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4272
    OBJ minWidth, minHeight, maxWidth, maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4273
    OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4274
    OBJ wiconWidth, wiconHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4275
    OBJ windowType, windowClass, windowId;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4276
    OBJ stClassName;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4277
    int isTopWindow = 0;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4278
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4279
    unsigned char* cp;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4280
    HBITMAP        xBitMap, maskBitmap;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4281
    int            height, width;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4282
    int            nBytes, nBits;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4283
    int            index;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4284
    HICON          xIcon = (HICON)0;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4285
    SIZE           oldSize;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4286
    ICONINFO       iconInfo;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4287
    char *className;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4288
    unsigned char *allocatedBits = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4289
    unsigned char fastBits[10000];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4290
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4291
    xpos = __ArrayInstPtr(moreArgs)->a_element[0];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4292
    ypos = __ArrayInstPtr(moreArgs)->a_element[1];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4293
    wwidth = __ArrayInstPtr(moreArgs)->a_element[2];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4294
    wheight = __ArrayInstPtr(moreArgs)->a_element[3];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4295
    minWidth = __ArrayInstPtr(moreArgs)->a_element[4];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4296
    minHeight = __ArrayInstPtr(moreArgs)->a_element[5];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4297
    maxWidth = __ArrayInstPtr(moreArgs)->a_element[6];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4298
    maxHeight = __ArrayInstPtr(moreArgs)->a_element[7];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4299
    wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4300
    wcursorId = __ArrayInstPtr(moreArgs)->a_element[9];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4301
    wiconId = __ArrayInstPtr(moreArgs)->a_element[10];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4302
    wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4303
    wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4304
    wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4305
    windowType = __ArrayInstPtr(moreArgs)->a_element[14];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4306
    windowClass = __ArrayInstPtr(moreArgs)->a_element[15];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4307
    eventMask = __ArrayInstPtr(moreArgs)->a_element[16];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4308
    stClassName = __ArrayInstPtr(moreArgs)->a_element[17];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4309
    bg = WhitePixel;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4310
    bd = BlackPixel;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4311
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4312
    /* get bitmap for icon */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4313
    if(  __isExternalAddress(wiconId) )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4314
    {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4315
	xBitMap = _HBITMAPVAL( wiconId );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4316
	if( xBitMap != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4317
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4318
	  BITMAP bm;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4319
	  if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4320
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4321
	    int d = bm.bmPlanes * bm.bmBitsPixel;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4322
	    BYTE *ep;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4323
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4324
	    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
  4325
	    height = __intVal( wiconHeight );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4326
	    width  = __intVal( wiconWidth  );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4327
	    nBytes = ( width + 15 ) / 16;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4328
	    nBytes = height * nBytes * 2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4329
	    if (nBytes < sizeof(fastBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4330
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4331
		ep = fastBits;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4332
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4333
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4334
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4335
		ep = allocatedBits = (unsigned char *) malloc(nBytes);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4336
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4337
	    if ( ep != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4338
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4339
		memset(ep,0,nBytes);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4340
		maskBitmap = CreateBitmap(width, height, 1, 1, ep );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4341
		if( maskBitmap != NULL )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4342
		{
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4343
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4344
		    iconInfo.fIcon = TRUE;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4345
		    iconInfo.hbmMask  = maskBitmap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4346
		    iconInfo.hbmColor = xBitMap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4347
		    xIcon = CreateIconIndirect( &iconInfo );
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4348
		    DPRINTF(( "ICON CREATED!!!\n" ));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4349
		    DelObject( maskBitmap );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4350
		} else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4351
		    DPRINTF(( "BITMAP mask CREATION failed!!!\n" ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4352
		}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4353
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4354
		PRINTF(( " malloc failed\n" ));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4355
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4356
	    if (allocatedBits)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4357
		free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4358
	  }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4359
	} else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4360
	    DPRINTF((" xBitMap is zero \n" ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4361
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4362
    } else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4363
	if (wiconId == nil) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4364
	    DPRINTF((" wiconId is nil\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4365
	} else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4366
	    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
  4367
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4368
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4369
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4370
    if (__bothSmallInteger(wwidth, wheight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4371
	w = __intVal(wwidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4372
	h = __intVal(wheight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4373
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4374
	w = h = 100;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4375
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4376
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4377
    if (__bothSmallInteger(xpos, ypos)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4378
	x = __intVal(xpos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4379
	y = __intVal(ypos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4380
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4381
	x = y = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4382
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4383
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4384
    if (__bothSmallInteger(minWidth, minHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4385
	min_width = __intVal(minWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4386
	min_height = __intVal(minHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4387
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4388
	min_width = min_height = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4389
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4390
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4391
    if (__bothSmallInteger(maxWidth, maxHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4392
	max_width = __intVal(maxWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4393
	max_height = __intVal(maxHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4394
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4395
	max_width = max_height = 10000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4396
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4397
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  4398
    winStyleBits = winEXStyleBits = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4399
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4400
    if (__isSmallInteger(bWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4401
	bw = __intVal(bWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4402
	if (bw) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4403
	    winStyleBits |= WS_BORDER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4404
	    bw = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4405
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4406
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4407
	bw = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4408
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4409
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4410
    className = app_name;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4411
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4412
#ifdef LATER
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4413
    if (__isString(windowClass)) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4414
	className = __stringVal(windowClass);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4415
    }
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4416
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4417
    if (__isString(windowClass)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4418
	if (__isInteger(wStyle)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4419
	    winStyleBits |= __longIntVal(wStyle);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4420
	} else {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4421
	    if (windowType == @symbol(RadioButton)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4422
		winStyleBits |= BS_RADIOBUTTON;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4423
	    } else if (windowType == @symbol(CheckBox)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4424
		winStyleBits |= BS_CHECKBOX;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4425
	    } else if (windowType == @symbol(HorizontalScrollbar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4426
		winStyleBits |= SBS_HORZ;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4427
	    } else if (windowType == @symbol(VerticalScrollBar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4428
		winStyleBits |= SBS_VERT;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4429
	    }
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4430
	}
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4431
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4432
#endif /* LATER */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4433
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4434
    if (__isExternalAddress(wsuperViewId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4435
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4436
	 * a child window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4437
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4438
	parentHandle = _HANDLEVal(wsuperViewId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4439
	winStyleBits |= WS_CHILD;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4440
	if (winputOnly != true) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4441
	    winStyleBits |= (WS_CLIPSIBLINGS|WS_CLIPCHILDREN);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4442
	    /*winStyleBits |= WS_CLIPCHILDREN;*/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4443
	    DPRINTF(("parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4444
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4445
	    winEXStyleBits |= WS_EX_TRANSPARENT;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4446
	    DPRINTF(("inputview parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4447
	}
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4448
    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4449
	char buf[300];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4450
	char *stName;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4451
	static winCount;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4452
#   ifdef __BORLANDC__
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4453
	struct timeb timebuffer;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4454
	ftime(&timebuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4455
#   else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4456
	struct _timeb timebuffer;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4457
	_ftime(&timebuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4458
#   endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4459
	if (__isString(stClassName)) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4460
	    stName = __stringVal(stClassName);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4461
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4462
	    stName = app_name;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4463
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4464
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4465
	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
  4466
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4467
	 * a top window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4468
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4469
	parentHandle = NULL;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4470
	isTopWindow = 1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4471
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4472
#ifdef TOPWINDOWCLASS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4473
	DPRINTF(("topview - registerClass:%s\n",buf));
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
	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
  4476
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4477
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4478
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4479
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4480
	if (xIcon) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4481
	    wc.hIcon   = xIcon;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4482
	    /* 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
  4483
	} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4484
	    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
  4485
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4486
	wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4487
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4488
	wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/
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
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4491
	wc.lpszClassName = buf;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4492
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4493
	if (!RegisterClass(&wc)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4494
	    PRINTF(("RegisterClass failed\n"));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4495
	    RETURN( nil );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4496
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4497
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4498
	className = buf;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4499
#endif
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4500
	if (wStyle == @symbol(popUp)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4501
	    winStyleBits |= WS_POPUP;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4502
	    winStyleBits |= WS_DISABLED;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4503
	    winEXStyleBits |= WS_EX_TOOLWINDOW;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4504
	    CPRINTF(("Create popUpWindow\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4505
	} else if (wStyle == @symbol(dialog)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4506
/*
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4507
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4508
*/
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4509
	    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
  4510
	    if ((min_width || min_height)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4511
	     && (min_width == max_width)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4512
	     && (min_height == max_height)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4513
		winStyleBits &= ~WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4514
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4515
	} else {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4516
	    //winStyleBits |= WS_OVERLAPPEDWINDOW;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4517
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |WS_MAXIMIZEBOX | WS_SIZEBOX;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4518
	    //winEXStyleBits |= WS_EX_CLIENTEDGE;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4519
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4520
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4521
	winStyleBits |= WS_CLIPCHILDREN;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4522
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4523
    rec.left = x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4524
    rec.top = y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4525
    rec.right = x + w;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4526
    rec.bottom = y+ h;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4527
    _thread_winStyleBitsEx = WS_EX_LEFT | WS_EX_NOPARENTNOTIFY | winEXStyleBits;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4528
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4529
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4530
    AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4531
    w = rec.right - rec.left;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4532
    h = rec.bottom - rec.top;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4533
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4534
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4535
    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
  4536
		((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
  4537
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4538
    /* allocate localMemory for Window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4539
    _thread_local = (localWindowInfo*)malloc(sizeof(localWindowInfo));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4540
    if (_thread_local)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4541
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4542
      memset(_thread_local,0,sizeof(*_thread_local));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4543
      if (isTopWindow)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4544
      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4545
	if (rec.left < 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4546
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4547
	  rec.left = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4548
	  rec.right = w;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4549
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4550
	if (rec.top < 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4551
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4552
	  rec.top = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4553
	  rec.bottom = h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4554
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4555
	_thread_local->flag = LI_TOPWIN;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4556
      }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4557
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4558
      if (winputOnly == true)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4559
	  _thread_local->flag |= LI_INPUTWIN;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4560
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4561
      _thread_className = className;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4562
      _thread_winStyleBits = winStyleBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4563
      _thread_parentHandle = parentHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4564
      _thread_x = rec.left;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4565
      _thread_y = rec.top;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4566
      _thread_dx = rec.right - rec.left;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4567
      _thread_dy = rec.bottom - rec.top;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4568
      rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4569
      rec.top = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4570
      rec.right = min_width;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4571
      rec.bottom = min_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4572
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4573
      AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4574
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4575
      _thread_local->minWidth = rec.right - rec.left;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4576
      _thread_local->minHeight = rec.bottom - rec.top;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4577
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4578
      rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4579
      rec.top = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4580
      rec.right = max_width;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4581
      rec.bottom = max_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4582
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4583
      AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4584
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4585
      _thread_local->maxWidth = rec.right - rec.left;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4586
      _thread_local->maxHeight = rec.bottom - rec.top;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4587
      _thread_local->bgBrush = 0; /*GetStockObject(HOLLOW_BRUSH);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4588
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4589
      if (__isSmallInteger(eventMask))
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4590
	  _thread_local->eventMask = __intVal(eventMask);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4591
      else
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4592
	  _thread_local->eventMask = 0xffffffff;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4593
      DPRINTF(("eventMask is %x\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4594
#ifdef DEBUGMASK1
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4595
      printMask(_thread_local->eventMask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4596
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4597
      _thread_newWinHandle = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4598
      _thread_windowName = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4599
      if (isTopWindow)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4600
      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4601
	  if (__isString(wlabel) || __isSymbol(wlabel)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4602
	      _thread_windowName = (char *) __stringVal(wlabel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4603
	      DPRINTF(("title = %s\n", _thread_windowName));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4604
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4605
      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4606
      PostThreadMessage(_dispatchThreadId,WM_THREADCREATEWINDOW,0,0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4607
      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4608
	DWORD dwWaitResult;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4609
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4610
	/* Request ownership of mutex. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4611
	dwWaitResult = WaitForSingleObject(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4612
	  hCreateEvent,   /* handle of mutex */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4613
	  15000L);   /* time-out interval */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4614
      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4615
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4616
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4617
    DPRINTF(("handle = %x\n", _thread_newWinHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4618
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4619
    if (! _thread_newWinHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4620
	DPRINTF(("handle is nil\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4621
	RETURN ( nil );
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
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4624
    windowId = __MKOBJ(_thread_newWinHandle);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4625
    if (_thread_newWinHandle)
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4626
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4627
      SetWindowPos(_thread_newWinHandle, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4628
#ifndef TOPWINDOWCLASS
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4629
      if (xIcon) 
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4630
      {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4631
	SendMessage(_thread_newWinHandle,WM_SETICON,ICON_SMALL,(LPARAM)xIcon);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4632
	SendMessage(_thread_newWinHandle,WM_SETICON,ICON_BIG,(LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4633
      }
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4634
#endif      
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4635
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4636
    DPRINTF(("done - create\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4637
    RETURN (windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4638
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4639
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4640
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4641
primDestroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4642
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4643
%{  /* xxLIMITEDSTACK (WIN95 only) */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4644
    HICON yIcon;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4645
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4646
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4647
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4648
	if (win && IsWindow(win))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4649
	{
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4650
#ifndef TOPWINDOWCLASS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4651
	   yIcon = (HICON)GetClassLong(_thread_newWinHandle,GCL_HICON);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4652
	   SetClassLong(_thread_newWinHandle,GCL_HICON,(DWORD)0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4653
	   /* 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
  4654
	   if( yIcon )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4655
	   {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4656
		if( DestroyIcon( yIcon ) )
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4657
		    DPRINTF(( "Old icon deleted\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4658
	   }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4659
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4660
	   /*printf("post WM_THREADDESTROYWINDOW\n");*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4661
	   PostMessage(win,WM_THREADDESTROYWINDOW,0,0);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4662
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4663
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4664
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4665
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4666
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4667
rootWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4668
    "return the id of the root window.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4669
     This is the window you see as background,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4670
     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
  4671
     since some window managers install a virtual root window on top
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4672
     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
  4673
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4674
    ^ rootWin
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4675
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4676
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4677
!WinWorkstation methodsFor:'color stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4678
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4679
colorRed:redVal green:greenVal blue:blueVal
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4680
    "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
  4681
     This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4682
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4683
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4684
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4685
    r := self percentToDeviceColorValue:redVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4686
    g := self percentToDeviceColorValue:greenVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4687
    b := self percentToDeviceColorValue:blueVal.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4688
    ^ self colorScaledRed:r scaledGreen:g scaledBlue: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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4691
colorScaledRed:r scaledGreen:g scaledBlue:b
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4692
    "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
  4693
     (i.e. colorID)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4694
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4695
    int id, ir, ig, ib;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4696
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4697
    if (__bothSmallInteger(r, g)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4698
     && __isSmallInteger(b))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4699
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4700
      id = RGB2st(__intVal(r),__intVal(g),__intVal(b));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4701
      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
  4702
      RETURN ( __MKSMALLINT(id) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4703
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4704
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4705
    self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4706
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4707
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4708
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4709
freeColor:colorIndex
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4710
    "free a display color when its no longer needed"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4711
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4712
    'free color' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4713
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4714
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4715
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4716
getRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4717
    "get rgb components (0..100) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4718
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4719
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4720
    |val|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4721
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4722
    self getScaledRGBFrom:index into:[:r :g :b |
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4723
	val := aBlock
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4724
		value:(r * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4725
		value:(g * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4726
		value:(b * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4727
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4728
    'get RGB' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4729
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4730
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4731
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4732
getRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4733
    "get rgb components (0..100) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4734
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4735
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4736
    |val|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4737
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4738
    self getScaledRGBFromName:colorName into:[:r :g :b |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4739
	r isNil ifTrue:[^nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4740
	val := aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4741
		value:(r * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4742
		value:(g * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4743
		value:(b * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4744
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4745
    ^val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4746
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4747
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4748
getScaledRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4749
    "get rgb components (0 .. 16rFFFF) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4750
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4751
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4752
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4753
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4754
    int id = __intVal(index);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4755
    int iR, iG, iB;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4756
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4757
    id = st2RGB(id,0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4758
    iR = id & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4759
    iG = (id >> 8) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4760
    iB = (id >> 16) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4761
    iR = (iR << 8) | iR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4762
    iG = (iG << 8) | iG;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4763
    iB = (iB << 8) | iB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4764
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4765
    r = __MKSMALLINT(iR);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4766
    g = __MKSMALLINT(iG);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4767
    b = __MKSMALLINT(iB);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4768
    /*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
  4769
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4770
    ^ aBlock value:r value:g value:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4771
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4772
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4773
getScaledRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4774
    "get scaled rgb components (0..16rFFFF) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4775
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4776
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4777
    |triple r g b found|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4778
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4779
    r := g := b := 0.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4780
    found := false.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4781
    (colorName startsWith:$#) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4782
	"/ color in r/g/b hex notation
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4783
	r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4784
	g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4785
	b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4786
	found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4787
    ] ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4788
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4789
	triple := StandardColorValues at:colorName asString ifAbsent:nil.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4790
	triple isNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4791
	    triple := StandardColorValues at:colorName asString asLowercase ifAbsent:nil.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4792
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4793
	triple notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4794
	    r := triple at:1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4795
	    g := triple at:2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4796
	    b := triple at:3.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4797
	    found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4798
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4799
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4800
    found ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4801
	('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4802
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4803
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4804
    ^ 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
  4805
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4806
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4807
listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4808
    "return a list of all available colornames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4809
     This should not be used, since colornames are very
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4810
     display-specific (here X-specific)."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4811
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4812
    |aStream list line index colorName|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4813
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4814
    aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4815
    aStream isNil ifTrue:[^ nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4816
    list := OrderedCollection new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4817
    [aStream atEnd] whileFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4818
	line := aStream nextLine.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4819
	line notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4820
	    "skip the r/g/b numbers"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4821
	    index := 1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4822
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4823
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4824
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4825
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4826
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4827
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4828
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4829
	    colorName := line copyFrom:index.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4830
	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4831
		list add:colorName
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4832
	    ]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4833
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4834
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4835
    aStream close.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4836
    ^ list sort
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4837
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4838
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4839
     Screen current listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4840
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4841
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4842
    "Modified: 11.9.1996 / 15:26:28 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4843
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4844
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4845
percentToDeviceColorValue:aPercentage
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4846
    "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
  4847
     WIN-component value (0..16rFFFF) as an integer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4848
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4849
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4850
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4851
    if (__isSmallInteger(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4852
	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4853
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4854
    if (__isFloat(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4855
	RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4856
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4857
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4858
    ^ (16rFFFF * aPercentage / 100) rounded
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4859
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4860
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4861
setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4862
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4863
 'setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue' printCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4864
^ self.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4865
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4866
    "Created: 30.1.1998 / 09:27:48 / md"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4867
    "Modified: 30.1.1998 / 09:30:22 / md"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4868
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4869
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4870
!WinWorkstation methodsFor:'cursor stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4871
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4872
builtInCursorShapes
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4873
    "return a collection of standard cursor names.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4874
     Those are built into Windows and need not be created as
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4875
     user cursors.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4876
     (actually, there are more than those below ...)"
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4877
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4878
    "/ if you add something here, also add to #shapeNumberFromCursor ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4879
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4880
    ^ #(
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4881
	#upLeftArrow            "/ IDC_ARROW
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4882
	#upDownArrow            "/ IDC_SIZENS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4883
	#leftRightArrow         "/ IDC_SIZEWE
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4884
	#text                   "/ IDC_IBEAM
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4885
	#wait                   "/ IDC_WAIT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4886
	#execute                "/ IDC_APPSTARTING
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4887
	#crossHair              "/ IDC_CROSS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4888
	#fourWay                "/ IDC_SIZEALL
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4889
	#upRightHand            "/ IDC_ARROW
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4890
       )
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4891
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4892
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4893
createCursorShape:aShape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4894
    "create a cursor given a shape-symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4895
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4896
    |number|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4897
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4898
    number := self shapeNumberFromSymbol:aShape.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4899
    ^ self primCreateCursorShapeNr:number
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4900
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4901
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4902
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
  4903
    "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
  4904
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4905
    |padding bpl bplPadded srcOffs dstOffs
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4906
     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
  4907
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4908
    cW := self class getSystemMetrics:#cursorWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4909
    cH := self class getSystemMetrics:#cursorHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4910
    "/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4911
    src := sourceBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4912
    mask := maskBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4913
    padding := self cursorBitmapPadding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4914
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4915
    "/ repadding and/or resizing required ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4916
    bpl := sourceBytes size / h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4917
    bplPadded := (cW + padding - 1) // padding * 2.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4918
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4919
    bpl ~~ bplPadded ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4920
	 "/     'repad cursor bits' infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4921
	srcPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4922
	nB := bpl min: bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4923
	nR := cH min: h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4924
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4925
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4926
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4927
	    srcPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4928
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4929
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4930
		with:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4931
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4932
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4933
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4934
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4935
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4936
	maskPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4937
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4938
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4939
	    maskPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4940
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4941
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4942
		with:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4943
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4944
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4945
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4946
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4947
	src := srcPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4948
	mask := maskPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4949
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4950
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4951
    src invert.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4952
    1 to:src size do:[:index |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4953
	src byteAt:index put:((src byteAt:index) bitAnd:(mask byteAt:index)).
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4954
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4955
    mask invert.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4956
    cursor := self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4957
	primCreateCursorSourceBits:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4958
	maskBits:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4959
	hotX:hx hotY:hy
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4960
	width:cW height:cH.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4961
    cursor notNil ifTrue:[  ^ cursor ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4962
    self halt.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4963
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4964
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4965
cursorBitmapPadding
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4966
    ^ 16 "/ windows requires short-padded rows
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4967
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4968
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4969
destroyCursor:aCursorId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4970
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4971
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4972
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4973
    if (ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4974
	if (__isExternalAddress(aCursorId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4975
	    HCURSOR curs = _HCURSORVal(aCursorId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4976
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4977
	    if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4978
#ifdef KEEP_STD_CURSORS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4979
		if ((curs != H_C_ARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4980
		 && (curs != H_C_CROSS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4981
		 && (curs != H_C_IBEAM)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4982
		 && (curs != H_C_ICON)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4983
		 && (curs != H_C_NO)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4984
		 && (curs != H_C_SIZE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4985
		 && (curs != H_C_SIZEALL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4986
		 && (curs != H_C_SIZENESW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4987
		 && (curs != H_C_SIZENS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4988
		 && (curs != H_C_SIZENWSE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4989
		 && (curs != H_C_UPARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4990
		 && (curs != H_C_WAIT)) 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4991
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4992
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4993
		    DestroyCursor(curs);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4994
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4995
	    __cnt_cur--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4996
	    RESPRINTF(("DestroyCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4997
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4998
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4999
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5000
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5001
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5002
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5003
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5004
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5005
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5006
needDeviceFormsForCursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5007
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5008
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5009
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5010
primCreateCursorShapeNr:number
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5011
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5012
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5013
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5014
    LPCTSTR cId;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5015
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5016
    if (__isSmallInteger(number)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5017
	cId = (LPCTSTR)(__intVal(number));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5018
	newCursor = LoadCursor(NULL, cId);
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5019
	if (newCursor) {
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  5020
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5021
	    if (cId == IDC_ARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5022
		H_C_ARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5023
	    else if (cId == IDC_CROSS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5024
		H_C_CROSS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5025
	    else if (cId == IDC_IBEAM)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5026
		H_C_IBEAM = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5027
	    else if (cId == IDC_ICON)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5028
		H_C_ICON = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5029
	    else if (cId == IDC_NO)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5030
		H_C_NO = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5031
	    else if (cId == IDC_SIZE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5032
		H_C_SIZE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5033
	    else if (cId == IDC_SIZEALL)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5034
		H_C_SIZEALL = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5035
	    else if (cId == IDC_SIZENESW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5036
		H_C_SIZENESW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5037
	    else if (cId == IDC_SIZENS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5038
		H_C_SIZENS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5039
	    else if (cId == IDC_SIZENWSE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5040
		H_C_SIZENWSE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5041
	    else if (cId == IDC_UPARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5042
		H_C_UPARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5043
	    else if (cId == IDC_WAIT)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5044
		H_C_WAIT = newCursor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5045
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5046
	    RETURN ( __MKOBJ(newCursor) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5047
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5048
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5049
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5050
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5051
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5052
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5053
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
  5054
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5055
%{  /* xxLIMITEDSTACK (WIN95) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5056
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5057
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5058
    if (__isByteArray(src)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5059
     && __isByteArray(mask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5060
     && __bothSmallInteger(hx, hy)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5061
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5062
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5063
	newCursor = CreateCursor((HANDLE) __getHInstance(),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5064
				 __intVal(hx), __intVal(hy),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5065
				 __intVal(w), __intVal(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5066
				 __ByteArrayInstPtr(mask)->ba_element,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5067
				 __ByteArrayInstPtr(src)->ba_element);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5068
	if (newCursor) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5069
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5070
	    __cnt_cur++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5071
	    RESPRINTF(("CreateCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5072
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5073
	    RETURN ( __MKOBJ(newCursor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5074
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5075
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5076
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5077
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5078
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5079
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5080
shapeNumberFromSymbol:shape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5081
    "given a shape-symbol, return the corresponding cursor-number,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5082
     or nil if no such standard cursor exists."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5083
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5084
    "this is pure Win-knowlegde - but you may easily add more"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5085
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5086
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5087
    if (shape == @symbol(upRightHand)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5088
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5089
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5090
    if (shape == @symbol(upLeftArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5091
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5092
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5093
    if (shape == @symbol(upDownArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5094
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENS));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5095
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5096
    if (shape == @symbol(leftRightArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5097
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5098
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5099
    if (shape == @symbol(text)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5100
	RETURN ( __MKSMALLINT( (INT)IDC_IBEAM));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5101
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5102
    if (shape == @symbol(wait)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5103
	RETURN ( __MKSMALLINT( (INT)IDC_WAIT));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5104
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5105
    if (shape == @symbol(crossHair)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5106
	RETURN ( __MKSMALLINT( (INT)IDC_CROSS));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5107
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5108
    if (shape == @symbol(fourWay)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5109
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL));
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
    if (shape == @symbol(execute)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5112
	RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5113
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5114
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5115
"/    ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5116
    ^  nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5117
! !
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
!WinWorkstation methodsFor:'drawing'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5120
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5121
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
  5122
		width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5123
    "do a bit-blt; copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5124
     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
  5125
     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
  5126
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5127
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5128
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5129
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5130
    struct gcData *dstGcData = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5131
    struct gcData *srcGcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5132
    HDC srcDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5133
    HDC dstDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5134
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5135
    if (__isExternalAddress(srcGCId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5136
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5137
	srcGcData = _GCDATA(srcGCId);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5138
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5139
    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5140
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5141
	goto fail;
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
    if (__isExternalAddress(dstGCId)) {
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5144
	dstGcData = _GCDATA(dstGCId);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5145
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5146
    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5147
    {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5148
	goto fail;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5149
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5150
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5151
    if (__bothSmallInteger(w, h)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5152
     && __bothSmallInteger(srcX, srcY)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5153
     && __bothSmallInteger(dstX, dstY))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5154
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5155
	int fun = BITBLT_COPY;
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5156
	if (srcGcData && dstGcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5157
	{
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5158
	  fun = dstGcData->bitbltrop2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5159
#if 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5160
	  switch (fun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5161
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5162
	    case BITBLT_COPY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5163
	      printf("BITBLT_COPY\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5164
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5165
	    case BITBLT_COPYINVERTED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5166
	      printf("BITBLT_COPYINVERTED\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5167
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5168
	    case BITBLT_XOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5169
	      printf("BITBLT_XOR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5170
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5171
	    case BITBLT_AND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5172
	      printf("BITBLT_AND\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5173
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5174
	    case BITBLT_OR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5175
	      printf("BITBLT_OR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5176
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5177
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5178
#endif
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5179
	  if (srcGcData->hWnd && ((srcGcData->hWnd == dstGcData->hWnd) && (fun == BITBLT_COPY)))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5180
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5181
	    RECT rec,uprec;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5182
	    rec.left = __intVal(srcX);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5183
	    rec.top = __intVal(srcY);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5184
	    rec.right = rec.left + __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5185
	    rec.bottom = rec.top + __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5186
	    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
  5187
	    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
  5188
	    UpdateWindow(srcGcData->hWnd);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5189
	    if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5190
	      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
  5191
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5192
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5193
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5194
	  if (srcGcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5195
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5196
	      /*printf("src is HWND %x\n",srcGcData->hWnd);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5197
	  }
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5198
	  fun = dstGcData->bitbltrop2;
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5199
	  if ((srcGcData == dstGcData) && (fun == BITBLT_COPY))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5200
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5201
	    RECT rec,uprec;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5202
	    rec.left = __intVal(srcX);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5203
	    rec.top = __intVal(srcY);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5204
	    rec.right = rec.left + __intVal(w);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5205
	    rec.bottom = rec.top + __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5206
	    srcDC = _getDC(srcGcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5207
	    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
  5208
	    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
  5209
	    _releaseDC(srcGcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5210
	    RETURN ( self );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5211
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
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5214
	  {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5215
	    srcDC = _getDC(srcGcData);
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5216
	    dstDC = _getDC(dstGcData);
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5217
	    DDPRINTF(("bitblt src f:%x b:%x",GetTextColor(srcDC),GetBkColor(srcDC)));
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5218
	    DDPRINTF(("dst f:%x b:%x\n",GetTextColor(dstDC),GetBkColor(dstDC)));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5219
	    if (BitBlt(dstDC,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5220
		 __intVal(dstX), __intVal(dstY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5221
		 __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5222
		 srcDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5223
		 __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5224
		 fun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5225
	       == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5226
	      )
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5227
	      {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5228
		 printf("ERROR in BitBlt\n");
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5229
	      }
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5230
	  }
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5231
	  _releaseDC(dstGcData);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5232
	  _releaseDC(srcGcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5233
	  RETURN ( self );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5234
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5235
    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  5236
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5237
 fail: ;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5238
%}.
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5239
 self primitiveFailed.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5240
 ^ nil
2232
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
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5243
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5244
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
  5245
		width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5246
    "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
  5247
     copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5248
     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
  5249
     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
  5250
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5251
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5252
    ^ self
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5253
	copyFromId:sourceId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5254
		 x:srcX y:srcY gc:srcDCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5255
		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
  5256
	     width:w height:h
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5257
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5258
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5259
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
  5260
    "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
  5261
     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
  5262
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5263
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5264
    int __x, __y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5265
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5266
    double f;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5267
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5268
    if (__isSmallInteger(startAngle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5269
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5270
    else if (__isFloat(startAngle)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5271
	angle1 = __floatVal(startAngle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5272
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5273
	angle1 = __shortFloatVal(startAngle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5274
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5275
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5276
    if (__isSmallInteger(angle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5277
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5278
    else if (__isFloat(angle)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5279
	angle2 = __floatVal(angle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5280
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5281
	angle2 = __shortFloatVal(angle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5282
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5283
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5284
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5285
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5286
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5287
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5288
     {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5289
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5290
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5291
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5292
	HPEN hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5293
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5294
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5295
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5296
	__x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5297
	__y = __intVal(y);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5298
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5299
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5300
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5301
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5302
	    DPRINTF(("displayArc: no pen\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5303
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5304
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5305
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5306
	    double xB, yB, xE, yE, xR, yR;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5307
	    HPEN hSavePen = SelectObject(hDC, hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5308
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5309
	    yR = h / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5310
	    if (angle2 - angle1 >= 360)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5311
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5312
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5313
		yB = yE = __y /*+ yR + 0.5*/;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5314
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5315
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5316
	    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5317
		double sin(), cos();
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5318
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5319
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5320
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5321
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5322
		angle2 = angle1 - angle2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5323
		/* sigh - compute the intersections ... */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5324
		xB = (cos((angle1 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5325
		yB = (sin((angle1 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5326
		xE = (cos((angle2 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5327
		yE = (sin((angle2 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5328
		xB = __x + xR - xB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5329
		yB = __y + yR - yB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5330
		xE = __x + xR - xE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5331
		yE = __y + yR - yE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5332
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5333
	    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
  5334
	    Arc(hDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5335
		__x, __y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5336
		__x + w, __y + h,
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5337
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5338
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5339
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5340
	    SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5341
	    DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5342
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5343
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5344
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5345
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5346
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5347
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5348
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5349
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5350
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5351
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
  5352
    "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
  5353
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5354
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5355
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5356
     /*&& __isExternalAddress(aDrawableId)*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5357
     && __bothSmallInteger(x0, y0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5358
     && __bothSmallInteger(x1, y1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5359
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5360
	int __x1 = __intVal(x1), __y1 = __intVal(y1);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5361
	HPEN hPen;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5362
	HDC hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5363
/*      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
  5364
		    __intVal(x0), __intVal(y0),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5365
		    __x1, __y1,_HWNDVal(aDrawableId)));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5366
*/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5367
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5368
	    DPRINTF(("displayLine: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5369
	} else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5370
	    HPEN hSavePen = SelectObject(hDC, hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5371
	    MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5372
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5373
	    LineTo(hDC, __x1, __y1);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5374
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5375
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5376
	     */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5377
	    LineTo(hDC, __x1+1, __y1);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5378
	    SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5379
	    DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5380
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5381
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5382
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5383
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5384
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5385
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5386
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5387
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
  5388
    "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
  5389
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5390
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5391
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5392
     && __isExternalAddress(aDrawableId)
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5393
     && __bothSmallInteger(px, py)) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5394
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5395
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5396
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5397
	HPEN hPen;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5398
	int __x = __intVal(px), __y = __intVal(py);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5399
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5400
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5401
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5402
	    DPRINTF(("displayPoint: no pen\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5403
	} else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5404
	    HPEN hSavePen = SelectObject(hDC, hPen);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5405
	    MoveToEx(hDC, __x, __y, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5406
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5407
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5408
	     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5409
	    LineTo(hDC, __x+1, __y);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5410
	    SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5411
	    DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5412
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5413
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5414
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5415
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5416
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5417
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5418
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5419
displayPolygon:aPolygon in:aDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5420
    "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
  5421
     which define the polygon.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5422
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5423
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5424
    |numberOfPoints |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5425
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5426
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5427
    self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5428
	primDisplayPolygon:aPolygon n:numberOfPoints
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5429
	in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5430
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5431
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5432
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
  5433
    "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
  5434
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5435
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5436
    int w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5437
    int xL, yT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5438
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5439
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5440
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5441
     && __bothSmallInteger(width, height)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5442
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5443
	HDC hDC = _getDC(gcData);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5444
	HPEN hPen;
1127
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
	xL = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5447
	yT = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5448
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5449
	h = __intVal(height);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5450
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5451
	DPRINTF(("displayRectangle: %d/%d -> %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5452
			xL, yT, w, h));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5453
	/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5454
	 * 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
  5455
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5456
	if ((w >= 0) && (h >= 0)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5457
	    if (!(hPen = GcDataGetPen(hDC,gcData))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5458
		DPRINTF(("displayRect: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5459
	    } else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5460
		HPEN hSavePen = SelectObject(hDC, hPen);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5461
		MoveToEx(hDC, xL, yT, NULL);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5462
		LineTo(hDC, xL+w-1, yT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5463
		LineTo(hDC, xL+w-1, yT+h-1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5464
		LineTo(hDC, xL, yT+h-1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5465
		LineTo(hDC, xL, yT);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5466
		SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5467
		DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5468
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5469
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5470
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5471
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5472
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5473
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5474
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5475
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5476
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
  5477
    "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
  5478
     foreground and background characters.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5479
     If the coordinates are not integers, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5480
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5481
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5482
    unsigned char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5483
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5484
    int  i1, i2, l, n;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5485
#   define NLOCALBUFFER 200
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5486
    short xlatebuffer[NLOCALBUFFER];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5487
    int nInstBytes;
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
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5490
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5491
     && __isNonNilObject(aString)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5492
     && __bothSmallInteger(index1, index2)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5493
     && __bothSmallInteger(x, y)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5494
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5495
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5496
	int pX, pY;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5497
	HDC hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5498
	HFONT hOldFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5499
	pX = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5500
	pY = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5501
	pY -= gcData->fontAscent;
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
	cls = __qClass(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5504
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5505
	i1 = __intVal(index1) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5506
	if (i1 >= 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5507
	    i2 = __intVal(index2) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5508
	    if (i2 < i1) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5509
		goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5510
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5511
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5512
	    cp = _stringVal(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5513
	    l = i2 - i1 + 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5514
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5515
	    if ((cls == @global(String)) || (cls == @global(Symbol))) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5516
	    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5517
		n = _stringSize(aString);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5518
		if (i2 < n) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5519
		{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5520
		    cp += i1;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  5521
		    DDPRINTF(("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
  5522
		    if (opaque == true) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5523
			SetBkMode(hDC, OPAQUE);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5524
		    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5525
			SetBkMode(hDC, TRANSPARENT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5526
		    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5527
		    hOldFont = SelectObject(hDC, gcData->hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5528
		    SetTextColor(hDC, gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5529
		    SetBkColor(hDC, gcData->bgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5530
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5531
		    if (!TextOut(hDC, pX, pY, (char *)cp, l))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5532
		    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5533
		       PRINTF(("Textout failed. %d\n",GetLastError()));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5534
		    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5535
		    SelectObject(hDC, hOldFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5536
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5537
		}
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5540
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5541
	    cp += nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5542
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5543
	    if (__isBytes(aString)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5544
	    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5545
		n = __byteArraySize(aString) - nInstBytes - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5546
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5547
		if (i2 < n) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5548
		{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5549
		    cp += i1;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  5550
		    DDPRINTF(("string: %s pos=%d/%d\n", cp, pX, pY));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5551
		    if (opaque == true) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5552
			SetBkMode(hDC, OPAQUE);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5553
		    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5554
			SetBkMode(hDC, TRANSPARENT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5555
		    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5556
		    hOldFont = SelectObject(hDC, gcData->hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5557
		    SetTextColor(hDC, gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5558
		    SetBkColor(hDC, gcData->bgColor);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5559
		    TextOut(hDC, pX, pY, (char *)cp, l);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5560
		    SelectObject(hDC, hOldFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5561
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5562
		}
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5565
#ifdef NOTDEF 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5566
	    /* TWOBYTESTRINGS */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5567
	    if (__isWords(aString)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5568
		n = (__byteArraySize(aString) - nInstBytes) / 2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5569
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5570
		if (i2 < n) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5571
		    union {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5572
			char b[2];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5573
			unsigned short s;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5574
		    } u;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5575
		    int i;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5576
		    XChar2b *cp2 = (XChar2b *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5577
		    int mustFree = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5578
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5579
		    cp += (i1 * 2);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5580
		    if (l > 1000) l = 1000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5581
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
		     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5584
		     * X expects them MSB first
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5585
		     * convert as required
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5586
		     */
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
		    u.s = 0x1234;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5589
		    if (u.b[0] != 0x12) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5590
			if (l <= NLOCALBUFFER) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5591
			    cp2 = xlatebuffer;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5592
			} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5593
			    cp2 = (XChar2b *)(malloc(l * 2));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5594
			    mustFree = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5595
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5596
			for (i=0; i<l; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5597
			    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5598
			    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5599
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5600
			cp = (char *) cp2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5601
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5602
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5603
		    if (opaque == true)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5604
			XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5605
		    else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5606
			XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5607
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5608
		    if (mustFree) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5609
			free(cp2);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5610
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5611
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5612
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5613
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5614
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5615
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5616
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5617
ret:   
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5618
	_releaseDC(gcData); 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5619
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5620
#undef NLOCALBUFFER
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5621
%}
2232
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
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5624
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5625
			  width:imageWidth height:imageHeight
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5626
			      x:srcx y:srcy
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5627
			   into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5628
			      x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5629
			  width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5630
			   with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5631
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5632
    "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
  5633
     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
  5634
     Individual source pixels have bitsPerPixel bits, allowing to draw
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5635
     depth and pixel-units to be different.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5636
     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
  5637
     depth - otherwise, primitive failure will be signalled.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5638
     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
  5639
     colors are allocated - otherwise the colors may be wrong."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5640
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5641
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5642
     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
  5643
     an unlimited stack, and thus cannot send primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5644
    "
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5645
    (self primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5646
					width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5647
					     x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5648
					  into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5649
					     x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5650
					 width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5651
					  with:aGCId)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5652
    ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5653
	"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5654
	 also happens, if a segmentation violation occurs in the
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5655
	 XPutImage ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5656
	"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5657
	self primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5658
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5659
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5660
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5661
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
  5662
	       in:aDrawableId with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5663
    "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
  5664
     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
  5665
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5666
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5667
    int __x, __y, w, h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5668
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5669
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5670
    if (__isSmallInteger(startAngle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5671
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5672
    else if (__isFloat(startAngle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5673
	angle1 = __floatVal(startAngle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5674
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5675
	angle1 = __shortFloatVal(startAngle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5676
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5677
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5678
    if (__isSmallInteger(angle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5679
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5680
    else if (__isFloat(angle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5681
	angle2 = __floatVal(angle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5682
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5683
	angle2 = __shortFloatVal(angle);
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5684
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5685
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5686
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5687
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5688
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5689
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5690
     {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5691
	struct gcData *gcData = _GCDATA(aGCId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5692
	HDC hDC;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5693
	HBRUSH hBrush;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5694
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5695
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5696
	h = __intVal(height);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5697
	__x = __intVal(x);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5698
	__y = __intVal(y);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5699
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5700
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5701
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5702
	if (!(hBrush = GcDataGetBrush(hDC,gcData))) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5703
	    DPRINTF(("fillArc: no brush\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5704
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5705
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5706
	{
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5707
	  HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5708
	  HPEN hPen = 0;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5709
	  HPEN hSavePen;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5710
	  if (__isWinNT)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5711
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5712
	    if (!(hPen = GcDataGetPen(hDC,gcData)))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5713
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5714
	      DPRINTF(("displayArc: no pen\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5715
	      goto failpen;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5716
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5717
	    hSavePen = SelectObject(hDC, hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5718
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5719
	  else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5720
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5721
	    SelectObject(hDC,GetStockObject(NULL_PEN));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5722
	    w++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5723
	    h++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5724
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5725
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5726
	    double xB, yB, xE, yE, xR, yR;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5727
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5728
	    yR = h / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5729
	    if (angle2 - angle1 >= 360)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5730
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5731
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5732
		yB = yE = __y /*+ yR + 0.5*/;
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
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5735
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5736
		double sin(), cos();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5737
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5738
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5739
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5740
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5741
		angle2 = angle1 - angle2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5742
		/* sigh - compute the intersections ... */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5743
		xB = (cos((angle1 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5744
		yB = (sin((angle1 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5745
		xE = (cos((angle2 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5746
		yE = (sin((angle2 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5747
		xB = __x + xR - xB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5748
		yB = __y + yR - yB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5749
		xE = __x + xR - xE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5750
		yE = __y + yR - yE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5751
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5752
	    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
  5753
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5754
	    Pie(hDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5755
		__x, __y,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5756
		__x + w, __y + h,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5757
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5758
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5759
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5760
	    if (hPen) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5761
	      SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5762
	      DelObject(hPen);
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
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5765
failpen:
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5766
	  SelectObject(hDC,hSaveBrush);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5767
	  DelObject(hBrush);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5768
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5769
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5770
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5771
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5772
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5773
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5774
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5775
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5776
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5777
fillPolygon:aPolygon in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5778
    "fill a polygon given by its points.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5779
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5780
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5781
    |numberOfPoints|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5782
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5783
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5784
    self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5785
	primFillPolygon:aPolygon n:numberOfPoints 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5786
	in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5787
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5788
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5789
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
  5790
    "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
  5791
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5792
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5793
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5794
    int w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5795
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5796
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5797
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5798
     && __bothSmallInteger(width, height)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5799
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5800
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5801
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5802
	/*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
  5803
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5804
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5805
	 * 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
  5806
	 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5807
	if ((w >= 0) && (h >= 0))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5808
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5809
	    struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5810
	    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5811
	    HBRUSH hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5812
	    RECT rct;
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
	    hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5815
	    hBrush = GcDataGetBrush(hDC,gcData);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5816
	    if (! hBrush)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5817
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5818
		PRINTF(("fillRectangle: no brush\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5819
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5820
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5821
	    {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5822
	      HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5823
	      rct.left = __intVal(x);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5824
	      rct.top = __intVal(y);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5825
	      rct.right = rct.left + w + 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5826
	      rct.bottom = rct.top + h + 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5827
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5828
	      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
  5829
	      SelectObject(hDC, GetStockObject(NULL_PEN));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5830
	      Rectangle(hDC,rct.left,rct.top,rct.right,rct.bottom);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5831
	      SelectObject(hDC,hSaveBrush);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5832
	      DelObject(hBrush);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5833
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5834
	    _releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5835
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5836
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5837
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5838
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5839
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5840
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5841
primDisplayPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5842
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5843
%{  /* xxLIMITEDSTACK (WIN95 only) */
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5844
    OBJ point, px, py;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5845
    int i, num;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5846
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5847
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5848
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5849
     && __isSmallInteger(numberOfPoints)) {
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5850
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5851
	HDC hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5852
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5853
	HPEN hPen;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5854
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5855
	num = __intVal(numberOfPoints);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5856
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5857
	for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5858
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5859
	    if (! __isPoint(point)) goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5860
	    px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5861
	    py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5862
	    if (! __bothSmallInteger(px, py))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5863
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5864
		_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5865
		goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5866
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5867
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5868
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5869
	    DPRINTF(("displayPolygon: no pen\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5870
	} else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5871
	    HPEN hSavePen = SelectObject(hDC, hPen);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5872
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5873
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5874
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5875
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5876
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5877
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5878
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5879
		    p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5880
		    p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5881
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5882
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5883
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5884
			LineTo(hDC, p.x, p.y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5885
			/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5886
			 * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5887
			 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5888
			LineTo(hDC, p.x+1, p.y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5889
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5890
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5891
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5892
	    SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5893
	    DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5894
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5895
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5896
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5897
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5898
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5899
fail: ;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5900
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5901
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5902
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5903
primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5904
			      width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5905
				  x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5906
			       into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5907
				  x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5908
			      width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5909
			       with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5910
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5911
    "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
  5912
     (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
  5913
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5914
%{  /* xxLIMITEDSTACK */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5915
    unsigned char fastBits[10000];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5916
    unsigned char *b_bits = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5917
    unsigned char *allocatedBits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5918
    struct gcData *gcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5919
    HDC hDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5920
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5921
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5922
     && __isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5923
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5924
     && __bothSmallInteger(srcx, srcy)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5925
     && __bothSmallInteger(dstx, dsty)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5926
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5927
     && __bothSmallInteger(imageWidth, imageHeight)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5928
     && __bothSmallInteger(imageDepth, bitsPerPixel)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5929
     && __isSmallInteger(padd)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5930
     && __isByteArray(imageBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5931
     {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5932
	struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5933
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5934
	  BITMAPINFOHEADER bmiHeader;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5935
	  DWORD r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5936
	  DWORD g;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5937
	  DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5938
	} bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5939
	gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5940
	if (! gcData )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5941
	    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5942
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5943
	DDPRINTF(("hDC = %x\n", hDC));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5944
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5945
	if (__intVal(padd) != WIN32PADDING)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5946
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5947
	  int row, col;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5948
	  unsigned char *cp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5949
	  unsigned char *pBits;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5950
	  int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding, nBytes;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5951
	  int bi = __intVal(bitsPerPixel);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5952
	  b_width = __intVal(w);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5953
	  b_height = __intVal(h);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5954
	  bytesPerRowST = (b_width * bi + (__intVal(padd)-1)) / __intVal(padd);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5955
	  bytesPerRowWN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5956
	  padding = bytesPerRowWN - bytesPerRowST;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5957
	  nBytes = b_height * bytesPerRowWN;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5958
	  /*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
  5959
	  if (padding)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5960
	  {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5961
	    if (nBytes < sizeof(fastBits))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5962
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5963
		cp = b_bits = fastBits;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5964
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5965
	    else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5966
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5967
		cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5968
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5969
	    if (cp)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5970
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5971
		pBits = __ByteArrayInstPtr(imageBits)->ba_element;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5972
		for (row = b_height; row; row--)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5973
		{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5974
		    for (col = bytesPerRowST; col; col--)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5975
		    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5976
			*cp++ = ( *pBits++ );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5977
		    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5978
		    cp += padding;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5979
		}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5980
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5981
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5982
	      goto fail;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5983
	  }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5984
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5985
	if (b_bits == 0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5986
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5987
	   b_bits = __ByteArrayInstPtr(imageBits)->ba_element;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5988
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5989
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5990
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5991
	bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5992
	bitmap.bmiHeader.biPlanes = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5993
	if (__intVal(imageDepth) == 24)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5994
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5995
	  /*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5996
	  bitmap.r = 0xff0000;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5997
	  bitmap.g = 0x00ff00;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5998
	  bitmap.b = 0x0000ff;*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5999
	  bitmap.bmiHeader.biCompression = BI_RGB;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6000
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6001
	else if (__intVal(imageDepth) == 16)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6002
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6003
	  /*bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6004
	  bitmap.bmiHeader.biCompression = BI_BITFIELDS;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6005
	  bitmap.b = 0x001f;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6006
	  bitmap.g = 0x07e0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6007
	  bitmap.r = 0xf800;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6008
	  bitmap.b = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6009
	  bitmap.g = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6010
	  bitmap.r = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6011
	  bitmap.bmiHeader.biCompression = BI_RGB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6012
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6013
	bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6014
	bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6015
	bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6016
	bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6017
	bitmap.bmiHeader.biClrImportant = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6018
	bitmap.bmiHeader.biWidth = __intVal(imageWidth);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6019
	bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6020
	bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6021
	/*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
  6022
	SetDIBitsToDevice(hDC,__intVal(dstx),__intVal(dsty),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6023
			      __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6024
			      __intVal(srcx), __intVal(srcy),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6025
			      0,__intVal(h),
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6026
			      (void *)b_bits,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6027
			      (BITMAPINFO*)&bitmap,DIB_RGB_COLORS);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6028
	if (allocatedBits)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6029
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6030
	  free(allocatedBits);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6031
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6032
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6033
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6034
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6035
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6036
fail: ;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6037
    PRINTF(("create temp bitmap FAILED!!!\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6038
    if (allocatedBits)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6039
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6040
      PRINTF(("freeing up temp bitmap bits ...\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6041
      free(allocatedBits);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6042
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6043
    if (gcData && hDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6044
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6045
%}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6046
.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6047
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6048
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6049
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6050
primFillPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6051
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6052
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6053
    OBJ point, px, py;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6054
    int i, num;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6055
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6056
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6057
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6058
     && __isSmallInteger(numberOfPoints)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6059
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6060
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6061
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6062
	HBRUSH hBrush;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6063
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6064
	num = __intVal(numberOfPoints);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6065
	if (num < 3) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6066
	    RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6067
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6068
	for (i=0; i<num; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6069
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6070
	    if (! __isPoint(point)) goto fail;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6071
	    px = _point_X(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6072
	    py = _point_Y(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6073
	    if (! __bothSmallInteger(px, py))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6074
		goto fail;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6075
	}
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6076
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6077
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6078
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6079
	if (!(hBrush = GcDataGetBrush(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6080
	    DPRINTF(("fillPolygon: no brush\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6081
	} else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6082
	    HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6083
	    BeginPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6084
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6085
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6086
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6087
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6088
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6089
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6090
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6091
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6092
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6093
			p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6094
			p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6095
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6096
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6097
			LineTo(hDC, __intVal(px), __intVal(py));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6098
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6099
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6100
	    }
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6101
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6102
	    EndPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6103
	    FillPath(hDC);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6104
	    SelectObject(hDC,hSaveBrush);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6105
	    DelObject(hBrush);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6106
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6107
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6108
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6109
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6110
fail: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6111
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6112
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6113
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6114
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6115
!WinWorkstation methodsFor:'event forwarding'!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6116
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6117
fontChange
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6118
    "the system fonts (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6119
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6120
     TODO: Tell the viewStyle to update itself,
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6121
	   and tell all views to reinit their style.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6122
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6123
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6124
    'WinWorkstation [info]: fontChange ignored for now.' infoPrintCR
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6125
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6126
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6127
queryEndSession
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6128
    "system is about to be shut down.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6129
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6130
     TODO: Tell all views to close themself.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6131
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6132
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6133
    'WinWorkstation [info]: queryEndSession ignored for now.' infoPrintCR
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6134
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6135
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  6136
systemColorChange:aWindowId
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6137
    "the system colors (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6138
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6139
     TODO: Tell the viewStyle to update itself,
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6140
	   and tell all views to reinit their style.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6141
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6142
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6143
    'WinWorkstation [info]: systemColorChange ignored for now.' infoPrintCR
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6144
! !
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6145
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6146
!WinWorkstation methodsFor:'event handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6147
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6148
configEventProcessedFor:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6149
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6150
    if (__isExternalAddress(aWindowId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6151
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6152
      HWND hWnd = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6153
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6154
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6155
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6156
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6157
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6158
dispatchEventFor:aViewIdOrNil withMask:eventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6159
    "central event handling method:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6160
     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
  6161
     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
  6162
     otherwise only events for the view with given id are processed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6163
     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
  6164
     handled.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6165
     WARNING: this may block to wait for an event - you better check for a
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6166
	      pending event before calling this."
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6167
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6168
    (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6169
	AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6170
	    ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6171
	] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6172
	    self dispatchLastEvent.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6173
	]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6174
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6175
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6176
    "Modified: 19.8.1997 / 17:10:42 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6177
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6178
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6179
dispatchExposeEventFor:aViewIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6180
    "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
  6181
     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
  6182
     otherwise only events for the view with given id are processed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6183
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6184
    self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6185
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6186
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6187
dispatchLastEvent
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6188
    |theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6189
     eventType|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6190
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6191
%{  /* xxSTACK: 8000 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6192
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6193
    struct queuedEvent _ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6194
    struct inlineCache *ipS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6195
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6196
    static struct inlineCache vid = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6197
    static struct inlineCache conf = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6198
    static struct inlineCache skp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6199
    static struct inlineCache skr = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6200
    static struct inlineCache exp = _ILC5;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6201
    static struct inlineCache gexpS = _ILC6;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6202
    static struct inlineCache nexpS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6203
    static struct inlineCache clr = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6204
    static struct inlineCache bp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6205
    static struct inlineCache br = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6206
    static struct inlineCache bmp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6207
    static struct inlineCache bsp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6208
    static struct inlineCache mot = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6209
    static struct inlineCache unmap = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6210
    static struct inlineCache map = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6211
    static struct inlineCache termS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6212
    static struct inlineCache destr = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6213
    static struct inlineCache setCurs = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6214
    static struct inlineCache focOut = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6215
    static struct inlineCache focIn = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6216
    static struct inlineCache act = _ILC2;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6217
    static struct inlineCache pe = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6218
    static struct inlineCache pl = _ILC2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6219
    static struct inlineCache vis = _ILC1;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  6220
    static struct inlineCache sysClrChg = _ILC1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6221
    static struct inlineCache fontChg = _ILC0;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6222
    static struct inlineCache qEndSess = _ILC0;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6223
    static struct inlineCache powerDown = _ILC0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6224
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6225
    int x, y, w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6226
    int keyCode, modifiers, isDoubleClick = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6227
    int isDown = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6228
    int state;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6229
    OBJ upDown;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6230
    OBJ eB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6231
    char nameBuffer[100];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6232
    HWND hWnd = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6233
    DDPRINTF(("dispatchLast\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6234
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6235
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6236
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6237
    if (__isByteArray(eB)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6238
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6239
    } else {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6240
	printf("DISPLAY: no eventBuffer\n");
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6241
	RETURN (false);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6242
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6243
    if (ev)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6244
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6245
      _ev_buf = *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6246
      ev = &_ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6247
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6248
    hWnd = ev->ev_hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6249
    if (!(hWnd /*&& IsWindow(hWnd)*/)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6250
	DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6251
	RETURN (false);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6252
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6253
    {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6254
	OBJ t;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6255
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6256
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6257
	 * 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
  6258
	 * avoid creation & lookup then.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6259
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6260
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6261
	if ((t = __INST(lastId)) != nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6262
	    if (__isExternalAddress(t)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6263
		if (_HWNDVal(t) == hWnd) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6264
		    theView = __INST(lastView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6265
		    if (__isNonNilObject(theView)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6266
			if (__qClass(theView) == nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6267
			    theView = nil;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6268
			}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6269
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6270
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6271
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6272
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6273
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6274
	if (theView == nil) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6275
	    windowID = __MKOBJ(ev->ev_hWnd);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6276
	    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
  6277
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6278
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6279
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6280
    if (theView == nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6281
	DPRINTF(("nil view [hWnd=%x] in dispatchEvent\n", ev->ev_hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6282
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6283
	RETURN (false);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6284
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6285
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6286
    switch (ev->ev_message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6287
#if 1
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6288
	    case WM_WINDOWPOSCHANGED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6289
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6290
		RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6291
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6292
		DPRINTF((">>> WM_WINDOWPOSCHANGED -> configureX:y:width:height:view:\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6293
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6294
		x = ev->ev_x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6295
		y = ev->ev_y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6296
		w = ev->ev_w;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6297
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6298
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6299
		/*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
  6300
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6301
		(*conf.ilc_func)(self,
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6302
			     @symbol(configureX:y:width:height:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6303
			     nil, &conf,
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6304
			     __MKSMALLINT(x),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6305
			     __MKSMALLINT(y),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6306
			     __MKSMALLINT(w),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6307
			     __MKSMALLINT(h),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6308
			     theView);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6309
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6310
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6311
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6312
	    case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6313
		if (ev->ev_wParam == TRUE) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6314
		    DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6315
		    arg = @symbol(unobscured);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6316
		    (*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6317
		    (*map.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6318
				     @symbol(mappedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6319
				     nil, &map, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6320
		} else {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6321
		    DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6322
		    arg = @symbol(fullyObscured);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6323
		    (*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
  6324
		    (*unmap.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6325
				       @symbol(unmappedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6326
				       nil, &unmap, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6327
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6328
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6329
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6330
	    case WM_CLOSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6331
		    (*termS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6332
				      @symbol(terminateView:), nil, &termS, theView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6333
		    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6334
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6335
	    case WM_DESTROY:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6336
		DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6337
		(*destr.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6338
				   @symbol(destroyedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6339
				   nil, &destr, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6340
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6341
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6342
	    case WM_ACTIVATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6343
		DPRINTF((">>> WM_ACTIVATE h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6344
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6345
		switch (LOWORD(ev->ev_wParam)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6346
		    case WA_INACTIVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6347
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6348
					@symbol(activate:view:),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6349
					nil,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6350
					&act,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6351
					false,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6352
					theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6353
			break;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6354
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6355
		    case WA_ACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6356
		    case WA_CLICKACTIVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6357
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6358
					@symbol(activate:view:),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6359
					nil,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6360
					&act,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6361
					true,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6362
					theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6363
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6364
		    default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6365
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6366
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6367
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6368
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6369
	    case WM_MOUSEACTIVATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6370
		DPRINTF((">>> WM_MOUSEACTIVATE h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6371
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6372
		(*focIn.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6373
				   @symbol(focusInView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6374
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6375
				   &focIn,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6376
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6377
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6378
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6379
	    case WM_SETFOCUS:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6380
		DPRINTF((">>> WM_SETFOCUS h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6381
		(*focIn.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6382
				   @symbol(focusInView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6383
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6384
				   &focIn,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6385
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6386
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6387
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6388
	    case WM_KILLFOCUS:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6389
		DPRINTF((">>> WM_KILLFOCUS h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6390
		(*focOut.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6391
				   @symbol(focusOutView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6392
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6393
				   &focOut,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6394
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6395
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6396
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6397
	    case __WM_GEXPOSE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6398
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6399
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6400
		w = ev->ev_w;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6401
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6402
		(*gexpS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6403
			 @symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6404
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6405
			 __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6406
			 __MKSMALLINT(w),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6407
			 __MKSMALLINT(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6408
			 true,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6409
			 theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6410
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6411
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6412
	    case __WM_NOGEXPOSE:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6413
		 (*nexpS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6414
			 @symbol(noExposeView:), nil, &nexpS,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6415
			 theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6416
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6417
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6418
	    case WM_PAINT:
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6419
		{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6420
		  RECT rec;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6421
		  HDC dc = (HDC)GetDC(ev->ev_hWnd);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6422
		  HBRUSH br = CreateSolidBrush(st2RGB(GetWindow_bgBrush(ev->ev_hWnd),0));
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6423
		  if (br)
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6424
		  {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6425
		    rec.left = ev->ev_x;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6426
		    rec.top = ev->ev_y;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6427
		    rec.right = ev->ev_w;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6428
		    rec.bottom = ev->ev_h;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  6429
		    //printf("erase %d %d %d %d\n",rec.left,rec.top,rec.right,rec.bottom);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6430
		    SelectClipRgn(dc,0);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6431
		    FillRect(dc, &rec, br);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6432
		    DelObject(br);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6433
		  }
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6434
		  ReleaseDC(ev->ev_hWnd,dc);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6435
		}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6436
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6437
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6438
		w = ev->ev_w;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6439
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6440
		/*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
  6441
	    /*expose:*/
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6442
		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
  6443
		(*exp.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6444
			 @symbol(exposeX:y:width:height:view:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6445
			 nil, &exp,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6446
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6447
			 __MKSMALLINT(y),
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6448
			 __MKSMALLINT((w - x + 1)),
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6449
			 __MKSMALLINT((h - y + 1)),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6450
			 theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6451
		break;
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_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6454
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6455
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6456
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6457
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6458
	    case WM_LBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6459
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6460
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6461
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6462
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6463
	    case WM_LBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6464
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6465
		goto commonButtonDown;
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
	    case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6468
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6469
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6470
		goto commonButtonDown;
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
	    case WM_MBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6473
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6474
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6475
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6476
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6477
	    case WM_MBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6478
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6479
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6480
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6481
	    case WM_RBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6482
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6483
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6484
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6485
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6486
	    case WM_RBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6487
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6488
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6489
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6490
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6491
	    case WM_RBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6492
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6493
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6494
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6495
	    commonButtonDown:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6496
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6497
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6498
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6499
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6500
		if (__INST(buttonTranslation) != nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6501
		    butt = __AT_(__INST(buttonTranslation), butt);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6502
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6503
		arg = butt;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6504
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6505
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6506
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6507
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6508
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6509
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6510
		if (isDoubleClick)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6511
		{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6512
		    multiClickState = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6513
		    nextMultiClickTime = lastMSGTime + multiClickTime;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6514
		    ipS = &bmp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6515
		    symS = @symbol(buttonMultiPress:x:y:view:);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6516
		}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6517
		else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6518
		{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6519
		    if (isDown)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6520
		    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6521
			if (multiClickState && (lastMSGTime < nextMultiClickTime))
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6522
			{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6523
			  nextMultiClickTime = lastMSGTime + multiClickTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6524
			  ipS = &bmp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6525
			  symS = @symbol(buttonMultiPress:x:y:view:);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6526
			}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6527
			else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6528
			{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6529
			  multiClickState = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6530
			  ipS = &bp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6531
			  symS = @symbol(buttonPress:x:y:view:);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6532
			}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6533
		    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6534
		    else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6535
		    {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6536
			ipS = &br;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6537
			symS = @symbol(buttonRelease:x:y:view:);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6538
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6539
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6540
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6541
		if (__isSymbol(arg)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6542
		    DPRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6543
				__stringVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6544
		} else {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6545
		    DPRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6546
				__intVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6547
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6548
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6549
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6550
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6551
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6552
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6553
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6554
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6555
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6556
	    case __WM_MOUSEENTER:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6557
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6558
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6559
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6560
		DPRINTF((">>> WM_MOUSEENTER: %d/%d %x\n", x, y, state));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6561
		(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6562
				    nil, &pe,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6563
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6564
				    __MKSMALLINT(x),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6565
				    __MKSMALLINT(y),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6566
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6567
		break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6568
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6569
	    case __WM_MOUSELEAVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6570
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6571
		DPRINTF((">>> WM_MOUSELEAVE: %d/%d %x\n", x, y, state));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6572
		(*pl.ilc_func)(self, @symbol(pointerLeave:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6573
				    nil, &pl,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6574
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6575
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6576
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6577
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6578
	    case WM_MOUSEMOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6579
		x = ev->ev_x;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6580
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6581
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6582
		DPRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6583
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6584
		(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6585
				    nil, &mot,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6586
				    __MKSMALLINT(state),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6587
				    __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6588
				    __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6589
				    theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6590
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6591
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6592
	    case WM_CHAR:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6593
		DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6594
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6595
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6596
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6597
		goto keyPressAndRelease;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6598
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6599
	    case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6600
	    case WM_KEYUP:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6601
		DPRINTF((">>> WM_KEYUP / SYSKEYUP: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6602
		symS = @symbol(keyRelease:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6603
		ipS = &skr;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6604
		upDown = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6605
		goto keyPressAndRelease;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6606
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6607
	    case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6608
	    case WM_KEYDOWN:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6609
#ifdef DEBUG
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6610
		if (ev->ev_keyCode == 0x11)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6611
		  c_count = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6612
#endif
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6613
		DPRINTF((">>> WM_KEYDOWN / SYSKEYDOWN: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6614
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6615
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6616
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6617
		/* FALL INTO */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6618
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6619
	    keyPressAndRelease: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6620
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6621
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6622
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6623
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6624
#ifdef NOTDEF
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6625
		{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6626
		    BYTE vKeyState[256];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6627
		    char buff[5];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6628
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6629
		    GetKeyboardState(vKeyState);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6630
		    ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6631
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6632
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6633
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6634
		keyCode = ev->ev_keyCode;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6635
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6636
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6637
		if (modifiers & TRANSLATED_KEY) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6638
		    if (modifiers & ControlMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6639
			if (keyCode < 0x20) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6640
			    keyCode = keyCode + 'a' - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6641
			    if (modifiers & ShiftMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6642
				keyCode = keyCode - 'a' + 'A';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6643
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6644
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6645
		    } else if (modifiers & (MetaMask | AltMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6646
			if (! (modifiers & ShiftMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6647
			    if ((keyCode >= 'A') && (keyCode <= 'Z')) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6648
				keyCode = keyCode - 'A' + 'a';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6649
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6650
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6651
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6652
		    arg = __MKCHARACTER(keyCode & 0xFF);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6653
		} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6654
		    switch (keyCode) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6655
			case VK_F1:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6656
			    arg = @symbol(F1);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6657
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6658
			case VK_F2:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6659
			    arg = @symbol(F2);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6660
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6661
			case VK_F3:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6662
			    arg = @symbol(F3);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6663
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6664
			case VK_F4:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6665
			    arg = @symbol(F4);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6666
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6667
			case VK_F5:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6668
			    arg = @symbol(F5);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6669
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6670
			case VK_F6:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6671
			    arg = @symbol(F6);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6672
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6673
			case VK_F7:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6674
			    arg = @symbol(F7);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6675
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6676
			case VK_F8:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6677
			    arg = @symbol(F8);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6678
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6679
			case VK_F9:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6680
			    arg = @symbol(F9);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6681
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6682
			case VK_F10:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6683
			    arg = @symbol(F10);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6684
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6685
			case VK_F11:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6686
			    arg = @symbol(F11);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6687
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6688
			case VK_F12:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6689
			    arg = @symbol(F12);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6690
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6691
			case VK_PRIOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6692
			    arg = @symbol(Prior);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6693
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6694
			case VK_NEXT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6695
			    arg = @symbol(Next);
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
			case VK_END:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6698
			    arg = @symbol(End);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6699
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6700
			case VK_HOME:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6701
			    arg = @symbol(Home);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6702
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6703
			case VK_LEFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6704
			    arg = @symbol(CursorLeft);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6705
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6706
			case VK_RIGHT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6707
			    arg = @symbol(CursorRight);
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
			case VK_UP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6710
			    arg = @symbol(CursorUp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6711
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6712
			case VK_DOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6713
			    arg = @symbol(CursorDown);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6714
			    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6715
			case VK_MENU:  /*alt key with w95 ???*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6716
			    arg = @symbol(Menu);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6717
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6718
			case VK_LMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6719
			    arg = @symbol(Menu_L);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6720
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6721
			case VK_RMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6722
			    arg = @symbol(Menu_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6723
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6724
			case VK_PAUSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6725
			    arg = @symbol(Pause);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6726
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6727
			case VK_HELP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6728
			    arg = @symbol(Help);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6729
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6730
			case VK_EXECUTE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6731
			    arg = @symbol(Execute);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6732
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6733
			case VK_CANCEL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6734
			    arg = @symbol(Cancel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6735
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6736
			case VK_SELECT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6737
			    arg = @symbol(Select);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6738
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6739
			case VK_PRINT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6740
			    arg = @symbol(Print);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6741
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6742
			case VK_SNAPSHOT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6743
			    arg = @symbol(Snapshot);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6744
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6745
			case VK_INSERT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6746
			    arg = @symbol(Insert);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6747
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6748
			case VK_DELETE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6749
			    arg = @symbol(Delete);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6750
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6751
			case VK_BACK:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6752
			    arg = @symbol(BackSpace);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6753
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6754
			case VK_LWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6755
			    arg = @symbol(Win_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6756
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6757
			case VK_RWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6758
			    arg = @symbol(Win_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6759
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6760
			case VK_APPS:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6761
			    arg = @symbol(Appl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6762
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6763
			case VK_NUMPAD0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6764
			    arg = @symbol(KeyPad0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6765
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6766
			case VK_NUMPAD1:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6767
			    arg = @symbol(KeyPad1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6768
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6769
			case VK_NUMPAD2:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6770
			    arg = @symbol(KeyPad2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6771
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6772
			case VK_NUMPAD3:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6773
			    arg = @symbol(KeyPad3);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6774
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6775
			case VK_NUMPAD4:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6776
			    arg = @symbol(KeyPad4);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6777
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6778
			case VK_NUMPAD5:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6779
			    arg = @symbol(KeyPad5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6780
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6781
			case VK_NUMPAD6:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6782
			    arg = @symbol(KeyPad6);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6783
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6784
			case VK_NUMPAD7:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6785
			    arg = @symbol(KeyPad7);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6786
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6787
			case VK_NUMPAD8:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6788
			    arg = @symbol(KeyPad8);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6789
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6790
			case VK_NUMPAD9:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6791
			    arg = @symbol(KeyPad9);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6792
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6793
			case VK_LSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6794
			    arg = @symbol(Shift_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6795
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6796
			case VK_RSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6797
			    arg = @symbol(Shift_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6798
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6799
			case VK_LCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6800
			    arg = @symbol(Ctrl_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6801
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6802
			case VK_RCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6803
			    arg = @symbol(Ctrl_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6804
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6805
			case VK_CONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6806
			    arg = @symbol(Ctrl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6807
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6808
			case VK_SHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6809
			    arg = @symbol(Shift);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6810
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6811
			case VK_TAB:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6812
			    arg = @symbol(Tab);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6813
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6814
			case VK_ESCAPE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6815
			    arg = @symbol(Escape);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6816
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6817
			case VK_NUMLOCK:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6818
			    arg = @symbol(NumLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6819
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6820
			case VK_SCROLL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6821
			    arg = @symbol(ScrollLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6822
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6823
			case VK_RETURN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6824
			    arg = @symbol(Return);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6825
			    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6826
			default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6827
			    nameBuffer[0] = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6828
			    /*GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6829
			    DPRINTF(("char is <%d>\n", keyCode));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6830
			    arg = __MKCHARACTER(keyCode & 0xFF);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6831
			    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6832
		    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6833
		 }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6834
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6835
		DPRINTF(("%s: code=%x mod=%x\n", __stringVal(symS),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6836
				keyCode, modifiers));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6837
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6838
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6839
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6840
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6841
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6842
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6843
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6844
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6845
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6846
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6847
				   theView);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6848
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6849
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6850
	   case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6851
		DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  6852
		(*sysClrChg.ilc_func)(self, @symbol(systemColorChange:), nil, &sysClrChg, theView);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6853
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6854
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6855
	   case WM_FONTCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6856
		DPRINTF((">>> WM_FONTCHANGE\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6857
		(*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6858
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6859
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6860
	   case WM_QUERYENDSESSION:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6861
		DPRINTF((">>> WM_QUERYENDSESSION\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6862
		(*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6863
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6864
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6865
#ifdef LATER
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6866
	   case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6867
		DPRINTF((">>> WM_POWER\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6868
		(*power.ilc_func)(self, @symbol(powerDown), nil, &power);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6869
	       break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6870
#endif
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6871
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6872
	    default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6873
		UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: >>> unhandled event: %x\n", ev->ev_message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6874
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6875
    }
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
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6878
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6879
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6880
dispatchPendingEvents
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6881
    "central event handling method for modal operation.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6882
     (i.e. this is now only used in the modal debugger)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6883
     Dispatch any pending events; return when no more are pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6884
     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
  6885
     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
  6886
     we only handle exposes until the graphicsExpose arrives.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6887
     Other systems may not need such a kludge"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6888
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6889
    "interested in exposes only ?"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6890
    dispatchingExpose notNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6891
	[self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6892
	    self dispatchExposeEventFor:dispatchingExpose
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6893
	].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6894
	^ self
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6895
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6896
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6897
    [self eventPendingWithSync:false] whileTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6898
	(self getEventFor:nil withMask:nil) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6899
	    AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6900
		ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6901
	    ] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6902
		self dispatchLastEvent
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6903
	    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6904
	].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6905
    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6906
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6907
    "Modified: 19.8.1997 / 17:11:18 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6908
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6909
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6910
disposeEventsWithMask:aMask for:aWindowIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6911
    "dispose (throw away) specific events. If aWindowId is nil,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6912
     events matching the mask are thrown away regardless of which
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6913
     view they are for. Otherwise, only matching events for that
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6914
     view are flushed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6915
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6916
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6917
   PRINTF(("disposeEventsWithMask:for: not yet implemented.\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6918
   RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6919
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6920
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6921
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6922
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6923
eventMaskFor:anEventSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6924
    "return the eventMask bit-constant corresponding to an event symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6925
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6926
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6927
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6928
    int m = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6929
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6930
    if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6931
    else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6932
    else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6933
    else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6934
    else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6935
    else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6936
    else if (anEventSymbol == @symbol(expose)) m = ExposureMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6937
    else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6938
    else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6939
    else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6940
    else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6941
    else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6942
    else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6943
    else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6944
    else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6945
    else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6946
    RETURN (__MKSMALLINT(m));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6947
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6948
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6949
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6950
eventPending
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6951
    "return true, if any event is pending.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6952
     This looks for both the internal queue and the display connection."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6953
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6954
    ConservativeSyncing == true ifTrue:[self sync].
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 notNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6957
	^ self exposeEventPendingFor:dispatchingExpose withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6958
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6959
    ^ self eventPendingWithSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6960
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6961
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6962
eventPending:anEventSymbol for:aWindowIdOrNil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6963
    "return true, if a specific event is pending"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6964
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6965
    ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6966
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6967
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6968
eventPendingWithSync:doSync
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6969
    "return true, if any event is pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6970
     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
  6971
    doSync notNil ifTrue:[self flush].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6972
%{  /* xxLIMITEDSTACK (WIN95 only) */
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6973
    MSG msg;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6974
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6975
    if (__INST(inRecursiveDispatch) == true) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6976
	RETURN (false);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6977
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6978
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6979
    if (isInputEvent()) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6980
	RETURN (true);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6981
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6982
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6983
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6984
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6985
eventQueued
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6986
    "return true, if any event is queued"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6987
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6988
    ^ self eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6989
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6990
    "Created: 12.12.1995 / 21:43:00 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6991
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6992
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6993
eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6994
    "return true, if any event is queued internally.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6995
     (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
  6996
      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
  6997
      the display connection)."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6998
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6999
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7000
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7001
    DDPRINTF(("peek q - "));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7002
    if (isInputEvent()) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7003
	DDPRINTF(("true\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7004
	RETURN (true);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7005
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7006
    DDPRINTF(("false\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7007
    RETURN ( false );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7008
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7009
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7010
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7011
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7012
    "return true, if any of the masked events is pending.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7013
     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
  7014
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7015
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7016
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7017
    DPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7018
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7019
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7020
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7021
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7022
exposeEventPendingFor:aWindowIdOrNil withSync:doSync
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7023
    "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
  7024
     or any view (if the arg is nil).
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7025
     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
  7026
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7027
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7028
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7029
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7030
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7031
getEventFor:aViewIdOrNil withMask:eventMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7032
    "read next event - put into local eventBuffer.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7033
     If aViewIdOrNil is nil, events for any view are fetched;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7034
     otherwise only events for that specific view will be fetched.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7035
     Returns true, if there was an event, false otherwise."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7036
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7037
%{  /* xxLIMITEDSTACK */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7038
    HWND win, wWanted;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7039
    int evMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7040
    OBJ eB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7041
    struct queuedEvent *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7042
    struct queuedEvent *qev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7043
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7044
    if (__isByteArray(eB)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7045
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7046
    } else {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7047
	printf("DISPLAY: no eventBuffer\n");
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7048
	RETURN (false);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7049
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7050
    ev->ev_message = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7051
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7052
    if (__isSmallInteger(eventMask)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7053
	evMask = __intVal(eventMask);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7054
    } else {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7055
	evMask = ~0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7056
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7057
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7058
    if (__isExternalAddress(aViewIdOrNil))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7059
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7060
	if (deqEvent(ev,_HWNDVal(aViewIdOrNil),evMask))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7061
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7062
	  RETURN ( true );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7063
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7064
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7065
    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7066
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7067
	if (deqEvent(ev,0,evMask))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7068
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7069
	  RETURN ( true );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7070
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7071
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7072
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7073
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7074
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7075
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7076
handleAllEvents
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7077
    "from now on, handle any kind of event"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7078
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7079
    dispatchingExpose := nil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7080
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7081
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7082
handleExposeOnlyFor:aView
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7083
    "from now on, handle expose events only"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7084
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7085
    "/ dispatchingExpose := aView id
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7086
    'handleExposeOnlyFor: not yet implemented' printCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7087
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7088
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7089
mappingChanged:what event:eB
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7090
    "One of Keyboard-, Modifier- or PointerMap has change, probably by xmodmap.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7091
     Tell xlib about the fact."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7092
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7093
    (what == #mappingKeyboard or:[what == #mappingModifier]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7094
	self refreshKeyboardMapping:eB.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7095
	"Maybe some of our modifiers have been changed"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7096
	self initializeModifierMappings.
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7099
    "Created: 1.12.1995 / 16:28:23 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7100
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7101
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7102
setEventMask:aMask in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7103
    "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
  7104
     is the bitwise or of the eventMask bits (see 'eventMaskFor:')"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7105
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7106
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7107
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7108
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7109
	&& __isSmallInteger(aMask))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7110
    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7111
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7112
	int mask = __intVal(aMask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7113
	if (GETLOCALWINDOWINFOPTR(hWnd))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7114
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7115
	  DPRINTF(("new eventMask %x\n",mask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7116
#ifdef DEBUGMASK
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7117
	  PRINTF(("new eventMask %x\n",mask));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7118
	  printMask(mask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7119
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7120
	  GETLOCALWINDOWINFOPTR(hWnd)->eventMask = mask;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7121
	  RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7122
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7123
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7124
%}.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7125
    self primitiveFailed
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7128
!WinWorkstation methodsFor:'event sending'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7129
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7130
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
  7131
    "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
  7132
     TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7133
     For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7134
     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
  7135
     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
  7136
     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
  7137
     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
  7138
     (not very user friendly)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7139
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7140
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7141
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7142
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7143
simulateKeyboardInput:aCharacterOrString inViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7144
    "send input to some other view, by simulating keyPress/keyRelease
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7145
     events.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7146
     Only a few control characters are supported.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7147
     Notice: not all alien views allow this kind of synthetic input;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7148
	     some simply ignore it."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7149
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7150
    |control code state|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7151
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7152
    aCharacterOrString isString ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7153
	aCharacterOrString do:[:char |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7154
	    self simulateKeyboardInput:char inViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7155
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7156
	^ self
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7157
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7158
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7159
    control := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7160
    code := aCharacterOrString asciiValue.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7161
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7162
    (aCharacterOrString == Character cr) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7163
	code := #Return
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7164
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7165
	(aCharacterOrString == Character tab) ifTrue:[
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7166
	    code := #Tab
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7167
	] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7168
	    (aCharacterOrString == Character esc) ifTrue:[
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7169
		code := #Escape
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7170
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7171
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7172
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7173
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7174
    control ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7175
	state := self controlMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7176
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7177
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7178
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7179
    "/ the stuff below should not be needed 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7180
    "/ (sendKeyOrButtonevent should be able to figure out things itself)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7181
    "/ however, on some linux systems it seems to not work correctly.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7182
    "/ Hopefully, this is correct ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7183
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7184
    code isNumber ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7185
	code >= $A asciiValue ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7186
	    code <= $Z asciiValue ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7187
		state := self shiftMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7188
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7189
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7190
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7191
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7192
    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
  7193
    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
  7194
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7195
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7196
      sending input to some (possibly alien) view:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7197
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7198
      |point id|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7199
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7200
      point :=  Display pointFromUser.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7201
      id := Display viewIdFromPoint:point.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7202
      Display simulateKeyboardInput:'Hello_world' inViewId:id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7203
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7204
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7205
    "Modified: 11.6.1996 / 10:59:42 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7206
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7207
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7208
!WinWorkstation methodsFor:'font stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7209
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7210
createFontFor:aFontName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7211
    "a basic method for font allocation; this method allows
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7212
     any font to be aquired (even those not conforming to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7213
     standard naming conventions, such as cursor, fixed or k14)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7214
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7215
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7216
    HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7217
    char *fn;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7218
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7219
    if (__isString(aFontName)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7220
	fn = __stringVal(aFontName);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7221
	if (strcmp(fn, "fixed") == 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7222
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7223
	} else if (strcmp(fn, "variable") == 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7224
	    hFont = GetStockObject(ANSI_VAR_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7225
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7226
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7227
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7228
	if (hFont) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7229
	    DPRINTF(("createFontFor:aFontName: %s -> %x\n", fn, hFont));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7230
	    RETURN ( __MKOBJ(hFont) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7231
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7232
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7233
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7234
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7235
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7236
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7237
fontMetricsOf:fontId into:aBlock
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7238
    "evaluate aBlock, passing a fonts metrics as arguments"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7239
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7240
    |data|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7241
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7242
    data := Array new:10.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7243
    (self primFontMetricsOf:fontId intoArray:data) isNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7244
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7245
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7246
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7247
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7248
    aBlock value:#iso8859
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7249
	   value:(data at:1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7250
	   value:(data at:2)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7251
	   value:(data at:3)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7252
	   value:(data at:4)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7253
	   value:(data at:5)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7254
	   value:(data at:6)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7255
	   value:(data at:7)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7256
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7257
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7258
fontsInFamily:aFamilyName face:aFaceName filtering:filter
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7259
    "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
  7260
     On WinWorkStations there is curently Face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7261
     But only thise matching filter (if nonNil)."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7262
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7263
    |allFonts fonts|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7264
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7265
    allFonts := self listOfAvailableFonts.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7266
    allFonts isNil ifTrue:[^ nil].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7267
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7268
    fonts := Set new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7269
    allFonts do:[:fntDescr |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7270
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7271
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7272
		fonts add:fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7273
	    ]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7274
	]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7275
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7276
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7277
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7278
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7279
fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7280
    "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
  7281
     on this display.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7282
     On WinWorkStations there is curently no style or Face
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7283
     But only those matching filter (if nonNIl)."
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7284
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7285
    |allFonts fonts|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7286
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7287
    allFonts := self listOfAvailableFonts.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7288
    allFonts isNil ifTrue:[^ nil].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7289
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7290
    fonts := Set new.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7291
    allFonts do:[:fntDescr |
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7292
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7293
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7294
		fonts add:fntDescr
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7295
	    ]
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7296
	]
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7297
    ].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7298
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7299
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7300
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7301
fullNameOf:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7302
    "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
  7303
     used for user feed-back (for example: in the fontPanel).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7304
     If the display/font do not provide that info, return nil."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7305
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7306
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7307
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7308
getAvailableFontsMatching:pattern
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7309
    "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
  7310
    self halt.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7311
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7312
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7313
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7314
getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7315
    "return a default font id - used when class Font cannot
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7316
     find anything usable"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7317
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7318
     ^ self createFontFor:'fixed'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7319
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7320
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7321
getFontWithFamily:familyString face:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7322
	    style:styleArgString size:sizeArg encoding:encodingSym
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7323
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7324
    "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
  7325
     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
  7326
     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
  7327
     can be aquired that way."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7328
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7329
    |styleString theName theId xlatedStyle id spacing|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7330
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7331
    styleString := styleArgString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7332
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7333
    "special: if face is nil, allow access to X-fonts"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7334
    faceString isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7335
	sizeArg notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7336
	    theName := familyString , '-' , sizeArg printString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7337
	] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7338
	    theName := familyString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7339
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7340
	theName isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7341
	    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7342
	     mhmh - fall back to the default font
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7343
	    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7344
	    theName := 'fixed'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7345
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7346
	theId := self createFontFor:theName.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7347
	theId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7348
	    theId := self getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7349
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7350
	^ theId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7351
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7352
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7353
    "/ spacing other than 'normal' is contained as last component
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7354
    "/ in style
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7355
    styleString notNil ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7356
	((styleString endsWith:'-narrow')
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7357
	 or:[styleString endsWith:'-semicondensed']) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7358
	    |i|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7359
	    i := styleString lastIndexOf:$-.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7360
	    spacing := styleString copyFrom:(i+1).
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7361
	    styleString := styleString copyTo:(i-1).
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7362
	] ifFalse:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7363
	    spacing := 'normal'.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7364
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7365
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7366
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7367
    xlatedStyle := styleString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7368
    xlatedStyle notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7369
	xlatedStyle := xlatedStyle first asString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7370
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7371
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7372
    id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7373
	    getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7374
	    family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7375
	    weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7376
	    slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7377
	    spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7378
	    pixelSize:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7379
	    size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7380
	    registry:encodingSym
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7381
	    encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7382
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7383
    id isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7384
	(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7385
	    "/ too stupid: encodings come in both cases
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7386
	    "/ and X does not ignore case
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7387
	    "/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7388
	    id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7389
		    getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7390
		    family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7391
		    weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7392
		    slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7393
		    spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7394
		    pixelSize:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7395
		    size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7396
		    registry:encodingSym asUppercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7397
		    encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7398
	    id isNil ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7399
		id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7400
			getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7401
			family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7402
			weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7403
			slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7404
			spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7405
			pixelSize:nil
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7406
			size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7407
			registry:encodingSym asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7408
			encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7409
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7410
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7411
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7412
    ^ id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7413
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7414
    "Modified: 24.2.1996 / 22:37:24 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7415
    "Modified: 4.7.1996 / 11:38:47 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7416
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7417
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7418
getFontWithFoundry:foundry family:family weight:weight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7419
	      slant:slant spacing:spc pixelSize:pSize size:size
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7420
	      registry:registry encoding:encoding
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7421
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7422
    "get the specified font, if not available, return nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7423
     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
  7424
     use this entry.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7425
     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
  7426
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7427
     foundry: 'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7428
     family:  'helvetica' 'courier' 'times' ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7429
     weight:  'bold' 'medium' 'demi' ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7430
     slant:   'r(oman)' 'i(talic)' 'o(blique)'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7431
     spacing: 'narrow' 'normal' semicondensed' ... usually '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7432
     pixelSize: 16,18 ... usually left empty
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7433
     size:      size in point (1/72th of an inch)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7434
     registry:  iso8859, sgi ... '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7435
     encoding:  vendor specific encoding (usually '*')
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7436
    "
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7437
    "
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7438
	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
  7439
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7440
		nHeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7441
		nWidth
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7442
		nEscapement
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7443
		nOrientation
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7444
		fnWeight        FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7445
		fdwItalic       TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7446
		fdwUnderline    TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7447
		fdwStrikeOut    TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7448
		fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7449
		fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7450
		fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7451
		fdwQuality      DEFAULT, DRAFT, or PROOF.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7452
		fdwPitchAndFamily
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7453
			DEFAULT, FIXED or VARIABLE pitch
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7454
			DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7455
		lpszFace
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7456
			Typeface Name
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7457
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7458
	These two above descriptions will be matched as follows:
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7459
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7460
		foundry - ignored
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7461
		family  - mapped to type face name.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7462
		weight  - mapped to fnWeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7463
		slant   - NOT USED INITIALLY  user for style
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7464
		spacing - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7465
		pixelSize - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7466
		size      - mapped to nHeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7467
		registry  - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7468
		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
  7469
	"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7470
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7471
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7472
    HGDIOBJ hFont;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7473
    int  nHeight, nWidth, nEscapement, nOrientation;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7474
    char* work;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7475
    char* work2;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7476
    DWORD fnWeight;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7477
    DWORD fdwItalic;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7478
    DWORD fdwUnderline;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7479
    DWORD fdwStrikeOut;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7480
    DWORD fdwCharSet;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7481
    DWORD fdwOutputPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7482
    DWORD fdwClipPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7483
    DWORD fdwQuality;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7484
    DWORD fdwPitchAndFamily;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7485
    LPCTSTR lpszFace;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7486
    static char temp[33];
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7487
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7488
/* INITIALIZE */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7489
    strcpy( temp, "                           " );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7490
    lpszFace = &temp[0];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7491
    strcpy( (char *)lpszFace, "NULL" );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7492
    nHeight  = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7493
    nWidth   = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7494
    nEscapement = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7495
    nOrientation = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7496
    fnWeight = FW_NORMAL;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7497
    fdwItalic = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7498
    fdwUnderline = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7499
    fdwStrikeOut = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7500
    fdwCharSet   = ANSI_CHARSET;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7501
    fdwOutputPrecision = OUT_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7502
    fdwClipPrecision   = CLIP_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7503
    fdwQuality         = DEFAULT_QUALITY;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7504
    fdwPitchAndFamily  = FF_DONTCARE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7505
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7506
/* SET VALUES */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7507
    if ( __isString( family ) ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7508
	work = __stringVal( family );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7509
	if ( strcmp( work, "nil" ) != 0 ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7510
	    strncpy( (char *)lpszFace, work, 32 );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7511
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7512
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7513
    if( __isString( weight ) ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7514
	work = __stringVal( weight );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7515
	if( strcmp( work, "bold" ) == 0 ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7516
	    fnWeight = FW_BOLD;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7517
    } else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7518
	if( strcmp( work, "medium" ) == 0 ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7519
	    fnWeight = FW_MEDIUM;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7520
	    } else {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7521
		if( strcmp( work, "demi" ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7522
		    fnWeight = FW_LIGHT;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7523
	    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7524
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7525
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7526
    if(__isSmallInteger( size ) )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7527
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7528
	nHeight = __intVal( size );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7529
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7530
    work2 = __stringVal( slant );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7531
    work  = __stringVal( slant );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7532
    if( strncmp( work2, "italic", 6 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7533
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7534
	fdwItalic = TRUE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7535
	if( work2[6] = '-' )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7536
	   strncpy( work, &work2[7], ( strlen( work2 ) - 7 ) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7537
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7538
    if( strncmp( work, "underline", 9 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7539
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7540
	fdwUnderline = TRUE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7541
	if( work[10] == '-' )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7542
	   strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7543
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7544
    if( strncmp( work2, "strikeOut", 9 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7545
	fdwStrikeOut = TRUE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7546
    nHeight = -MulDiv(nHeight, __logPixelSY, 72);
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
    DPRINTF(("CreateFont %s h=%d\n",lpszFace,nHeight));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7549
    hFont = CreateFont( nHeight,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7550
			nWidth,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7551
			nEscapement,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7552
			nOrientation,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7553
			fnWeight,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7554
			fdwItalic,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7555
			fdwUnderline,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7556
			fdwStrikeOut,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7557
			fdwCharSet,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7558
			fdwOutputPrecision,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7559
			fdwClipPrecision,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7560
			fdwQuality,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7561
			fdwPitchAndFamily,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7562
			lpszFace );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7563
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7564
    if( hFont != NULL )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7565
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7566
	DPRINTF(("createFontWithFoundry: %x\n", hFont));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7567
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7568
	    __cnt_font++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7569
	   RES1PRINTF(("CreateFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7570
#endif
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7571
	RETURN ( __MKOBJ(hFont) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7572
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7573
    DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7574
%}.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7575
    ^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7576
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7577
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7578
     Display getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7579
			 family:'courier'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7580
			 weight:'medium'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7581
			  slant:'r'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7582
			spacing:nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7583
		      pixelSize:nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7584
			   size:13
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7585
		       registry:'iso8859'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7586
		       encoding:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7587
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7588
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7589
    "new NT Version: 20.2.1997 / 22:33:29 / dq"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7590
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7591
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7592
listOfAvailableFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7593
    "return a list with all available fonts on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7594
     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
  7595
     next time. The elements of the returned collection are instances of
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7596
     FontDescription."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7597
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7598
    |list typeFaceList|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7599
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7600
    listOfFonts notNil ifTrue:[^ listOfFonts].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7601
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7602
    list := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7603
    typeFaceList := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7604
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7605
    [
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7606
      self primEnumFontTypesInto:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7607
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7608
      "/Transcript showCR:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7609
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7610
      typeFaceList do:[:typeFace |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7611
	  self primEnumFontsIn:typeFace into:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7612
	  0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7613
      ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7614
    ] valueUninterruptably.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7615
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7616
    "/Transcript showCR:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7617
    listOfFonts := list
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7618
		       collect:[:anArray |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7619
			| fntDescr family face style size encoding |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7620
			family := anArray at:14.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7621
			face   := anArray at:5.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7622
			style  := anArray at:16.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7623
			size   := anArray at:1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7624
			encoding := anArray at:15.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7625
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7626
			fntDescr := FontDescription
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7627
					family:family
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7628
					face:face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7629
					style:style
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7630
					size:size
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7631
					encoding:encoding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7632
			fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7633
		       ].
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7634
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7635
    ^ listOfFonts
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
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7638
     Display listOfAvailableFonts.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7639
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7640
     Display getAvailableFontsMatching:'*'.
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7643
    "Modified: 27.9.1995 / 10:54:47 / stefan"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7644
    "Modified: 17.4.1996 / 15:27:57 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7645
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7646
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7647
primEnumFontTypesInto:typeFaceList
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7648
%{      /* xxLIMITEDSTACK (WIN95) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7649
	if (tmpDC)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7650
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7651
	    if ( EnumFontFamilies( tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7652
		DPRINTF(("EnumFonts successful\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7653
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7654
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7655
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7656
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7657
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7658
primEnumFontsIn:typeFace into:fontList
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7659
%{      /* xxLIMITEDSTACK (WIN95) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7660
	char *cp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7661
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7662
	if (__isString(typeFace))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7663
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7664
	    if (tmpDC) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7665
		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
  7666
		    DPRINTF(("EnumFonts Successful\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7667
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7668
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7669
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7670
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7671
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7672
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7673
primFontMetricsOf:fontId intoArray:data
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7674
    "evaluate aBlock, passing a fonts metrics as arguments"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7675
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7676
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7677
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7678
    if (__isExternalAddress(fontId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7679
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7680
	SIZE size;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7681
	int avgWidth;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7682
	HGDIOBJ hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7683
	HGDIOBJ prevFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7684
	TEXTMETRIC tmet;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7685
	int len;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7686
	hFont = _HGDIOBJVal(fontId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7687
	/*
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7688
	 * temporarily set this font in the root context
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7689
	 */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7690
	prevFont = SelectObject(tmpDC, hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7691
	GetTextMetrics(tmpDC, &tmet);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7692
	GetTextExtentPoint32(tmpDC,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7693
	 "uvwxyz",52,&size);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7694
	SelectObject(tmpDC, prevFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7695
	avgWidth = (size.cx/26+1)/2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7696
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7697
	__ArrayInstPtr(data)->a_element[0] = __MKSMALLINT(tmet.tmAscent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7698
	__ArrayInstPtr(data)->a_element[1] = __MKSMALLINT(tmet.tmDescent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7699
	__ArrayInstPtr(data)->a_element[2] = __MKSMALLINT(tmet.tmAscent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7700
	__ArrayInstPtr(data)->a_element[3] = __MKSMALLINT(tmet.tmDescent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7701
	__ArrayInstPtr(data)->a_element[4] = __MKSMALLINT(avgWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7702
	__ArrayInstPtr(data)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7703
	__ArrayInstPtr(data)->a_element[6] = __MKSMALLINT(avgWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7704
	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
  7705
		    hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7706
		    tmet.tmAveCharWidth));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7707
	RETURN (self);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7708
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7709
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7710
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7711
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7712
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7713
releaseFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7714
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7715
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7716
    if (__isExternalAddress(aFontId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7717
	HGDIOBJ hFont = _HGDIOBJVal(aFontId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7718
	if (hFont)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7719
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7720
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7721
	    __cnt_font--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7722
	   RES1PRINTF(("DestroyFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7723
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7724
	  DelObject(hFont);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7725
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7726
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7727
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7728
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7729
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7730
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7731
    "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
  7732
     on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7733
     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
  7734
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7735
    |sizes|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7736
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7737
    sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7738
    (sizes notNil and:[sizes includes:0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7739
	"special: in X11R5 and above, size 0 means:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7740
	 there are scaled versions in all sizes available"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7741
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7742
	^ #(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
  7743
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7744
    ^ sizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7745
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7746
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7747
     Display sizesInFamily:'courier' face:'bold' style:'roman'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7748
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7749
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7750
    "Created: 27.2.1996 / 01:38:15 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7751
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7752
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7753
widthOf:aString from:index1 to:index2 inFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7754
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7755
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7756
    char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7757
    int len, n, i1, i2, l;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7758
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7759
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7760
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7761
	if (__bothSmallInteger(index1, index2)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7762
	 && __isExternalAddress(aFontId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7763
	 && __isNonNilObject(aString)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7764
	    HGDIOBJ hFont,prevFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7765
	    SIZE tsize;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7766
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7767
	    hFont = _HGDIOBJVal(aFontId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7768
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7769
	    i1 = __intVal(index1) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7770
	    cls = __qClass(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7771
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7772
	    if (i1 >= 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7773
		i2 = __intVal(index2) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7774
		if (i2 < i1) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7775
		    RETURN ( __MKSMALLINT( 0 ) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7776
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7777
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7778
		cp = (char *) _stringVal(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7779
		l = i2 - i1 + 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7780
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7781
		if ((cls == @global(String)) || (cls == @global(Symbol))) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7782
		    n = _stringSize(aString);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7783
		    if (i2 < n)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7784
		    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7785
			cp += i1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7786
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7787
			prevFont = SelectObject(tmpDC, hFont);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7788
			GetTextExtentPoint32(tmpDC, cp, l, &tsize);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7789
#ifdef xxDEBUG
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7790
			if (__debug__)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7791
			{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7792
			  char buf[80];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7793
			  GetTextFace(tmpDC,80,buf);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7794
			  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
  7795
			}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7796
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7797
			SelectObject(tmpDC, prevFont);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7798
			RETURN ( __MKSMALLINT(tsize.cx) );
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
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7801
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7802
		nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7803
		cp += nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7804
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7805
		if (__isBytes(aString)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7806
		    n = __byteArraySize(aString) - nInstBytes;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7807
		    if (i2 < n)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7808
		    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7809
			cp += i1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7810
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7811
			prevFont = SelectObject(tmpDC, hFont);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7812
			GetTextExtentPoint32(tmpDC, cp, l, &tsize);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7813
#ifdef xxDEBUG
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7814
			if (__debug__)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7815
			{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7816
			  char buf[80];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7817
			  GetTextFace(tmpDC,80,buf);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7818
			  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
  7819
			}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7820
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7821
			SelectObject(tmpDC, prevFont);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7822
			RETURN ( __MKSMALLINT(tsize.cx) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7823
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7824
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7825
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7826
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7827
#undef NLOCALBUFFER
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7828
%}.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7829
"/  'no stringlen' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7830
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7831
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7832
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7833
!WinWorkstation methodsFor:'grabbing '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7834
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7835
allowEvents:mode
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7836
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7837
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7838
grabKeyboardIn:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7839
    "grab the keyboard"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7840
%{    
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7841
    if (__isExternalAddress(aWindowId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7842
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7843
      HWND hWnd = _HWNDVal(aWindowId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7844
      CPRINTF(("grabKeyboard in %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7845
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7846
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7847
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7848
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7849
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7850
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7851
    "grap the pointer - return true if ok"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7852
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7853
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7854
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7855
	HWND hWnd = _HWNDVal(aWindowId);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7856
	{
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7857
	  HCURSOR hCursor = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7858
	  if (currentCapture != CAPTURE_NONE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7859
	  {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7860
	    PostMessage(currentPointerView,WM_THREADSETCAPTURE,0,0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7861
	    //ReleaseCapture();
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7862
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7863
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7864
	  if (hWnd == __rootWin)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7865
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7866
	     hWnd = __rootWinSpezial;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7867
	     ShowWindow(hWnd,SW_SHOWNOACTIVATE);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7868
	     //EnableWindow(hWnd,TRUE);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7869
	     SetWindowPos(hWnd, HWND_TOP,
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7870
	      0, 0, 0, 0,SWP_NOREDRAW|SWP_NOSENDCHANGING|SWP_NOCOPYBITS
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7871
	      |SWP_NOACTIVATE |SWP_NOMOVE|SWP_NOSIZE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7872
	     CPRINTF(("setRootCapture %x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7873
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7874
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7875
	  if (__isExternalAddress(aCursorId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7876
	  {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7877
	      hCursor = _HCURSORVal(aCursorId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7878
	  }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7879
	  CPRINTF(("grabPointerIn  SetCapture %x\n",hWnd));
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7880
	  PostMessage(hWnd,WM_THREADSETCAPTURE,(INT)hWnd,(INT)hCursor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7881
	  if (__isExternalAddress(aCursorId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7882
	  {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7883
	      RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7884
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7885
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7886
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7887
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7888
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7889
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7890
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7891
ungrabKeyboard
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7892
    "release the keyboard"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7893
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7894
    activeKeyboardGrab := nil.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7895
%{    
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7896
    CPRINTF(("ungrabKeyboard\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7897
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7898
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7899
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7900
ungrabPointer
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7901
    "release the pointer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7902
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7903
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7904
    CPRINTF(("ungrabPointer 1\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7905
    PostThreadMessage(_dispatchThreadId,WM_THREADSETCAPTURE,0,0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7906
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7907
    activePointerGrab := nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7908
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7909
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7910
!WinWorkstation methodsFor:'graphic context stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7911
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7912
noClipIn:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7913
    "disable clipping rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7914
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7915
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7916
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7917
    if (__isExternalAddress(aWindowId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7918
     && __isExternalAddress(aGCId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7919
     {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7920
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7921
	gcData->clipping = FALSE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7922
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7923
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7924
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7925
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7926
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7927
setBackground:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7928
    "set background color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7929
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7930
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7931
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7932
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7933
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7934
    if (__isExternalAddress(aGCId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7935
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7936
	COLORREF bgColor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7937
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7938
	//hDC = _getDC(gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7939
	bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7940
	if (bgColor != gcData->bgColor) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7941
	    gcData->bgColor = bgColor;
2251
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  7942
	    // SetBkColor(hDC, bgColor);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7943
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7944
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7945
	DPRINTF(("setBackground: %x\n", bgColor));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7946
	//_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7947
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7948
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7949
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7950
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7951
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7952
setBitmapMask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7953
    "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
  7954
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7955
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7956
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  7957
    if (__isExternalAddress(aGCId)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7958
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  7959
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7960
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  7961
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7962
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  7963
	    gcData->hMask = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7964
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7965
	DPRINTF(("masks set to %x\n",gcData->hMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7966
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7967
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7968
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7969
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7970
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7971
setClipByChildren:aBool in:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7972
    "enable/disable drawing into child views"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7973
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7974
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7975
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7976
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7977
    if (ISCONNECTED && __isExternalAddress(aGCId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7978
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7979
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7980
	if (gcData && gcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7981
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7982
	    if( aBool == true )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7983
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7984
		/* set clip by child */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7985
		if (gcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7986
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7987
		  gcData->clipByChild = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7988
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7989
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7990
	    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7991
		if (gcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7992
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7993
		  gcData->clipByChild = FALSE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7994
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7995
	    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7996
	} else {
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7997
	    DPRINTF(("clipping by child failed - invalid win\n" ));
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7998
	}
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7999
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8000
%}.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8001
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8002
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8003
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8004
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
  8005
    "clip to a rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8006
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8007
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8008
      p--w---
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8009
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8010
      h     |  the clipping rectangle
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8011
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8012
      -------
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8013
	  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
  8014
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8015
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8016
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8017
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8018
    /*RETURN (self);*/
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8019
    if (  __isExternalAddress(aGCId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8020
       && __bothSmallInteger(clipX, clipY)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8021
       && __bothSmallInteger(clipWidth, clipHeight) ) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8022
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8023
	gcData->clipping = TRUE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8024
	gcData->clipX = __intVal(clipX); 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8025
	gcData->clipY = __intVal(clipY); 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8026
	gcData->clipW = __intVal(clipWidth); 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8027
	gcData->clipH = __intVal(clipHeight); 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8028
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8029
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8030
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8031
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8032
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8033
setDashes:dashList dashOffset:offset in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8034
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8035
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8036
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8037
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8038
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8039
	PRINTF(("dashes not yet implemented\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8040
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8041
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8042
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8043
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8044
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8045
setFont:aFontId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8046
    "set font to be drawn in"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8047
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8048
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8049
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8050
    if (__isExternalAddress(aGCId)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8051
     && __isExternalAddress(aFontId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8052
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8053
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8054
	HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8055
	HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8056
	TEXTMETRIC tmet;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8057
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8058
	hDC = _getDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8059
	hFont = _HGDIOBJVal(aFontId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8060
	gcData->hFont = hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8061
	hFont = SelectObject(hDC, hFont);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8062
	GetTextMetrics(hDC, &tmet);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8063
	gcData->fontAscent = tmet.tmAscent;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8064
#ifdef DEBUG
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8065
	if (__debug__)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8066
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8067
	  char buf[80];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8068
	  GetTextFace(hDC,80,buf);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8069
	  PRINTF(("setFont: %x %s\n", hFont,buf));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8070
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8071
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8072
	SelectObject(hDC, hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8073
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8074
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8075
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8076
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8077
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8078
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8079
setForeground:fgColorIndex background:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8080
    "set foreground and background colors to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8081
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8082
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8083
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8084
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8085
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8086
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8087
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8088
	gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  8089
	DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8090
	RETURN (self);
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
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8093
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8094
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8095
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8096
    "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
  8097
     solid (if aBitmapId is nil)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8098
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8099
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8100
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8101
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8102
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8103
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8104
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8105
	gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8106
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8107
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8108
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8109
	    gcData->hMask = 0;
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  8110
	DDPRINTF(("setForeground: %x background: %x mask: %x\n", gcData->fgColor, gcData->bgColor,gcData->hMask));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8111
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8112
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8113
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8114
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8115
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8116
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
  8117
    "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
  8118
     solid (if aBitmapId is nil); also set lineWidth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8119
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8120
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8121
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8122
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8123
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8124
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8125
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8126
	gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8127
	gcData->lineWidth = __intVal(lw);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8128
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8129
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8130
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8131
	    gcData->hMask = 0;
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  8132
	DDPRINTF(("setForeground: %x background: %x mask: %x linewidth: %d\n", gcData->fgColor, gcData->bgColor,gcData->hMask,gcData->lineWidth));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8133
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8134
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8135
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8136
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8137
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8138
setForeground:fgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8139
    "set foreground color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8140
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8141
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8142
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8143
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8144
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8145
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8146
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8147
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8148
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  8149
	DDPRINTF(("setForeground: %x\n", gcData->fgColor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8150
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8151
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8152
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8153
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8154
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8155
setFunction:aFunctionSymbol in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8156
    "set alu function to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8157
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8158
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8159
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8160
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8161
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8162
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8163
	int fun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8164
	int bfun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8165
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8166
	if (aFunctionSymbol == @symbol(copy)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8167
	  fun = R2_COPYPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8168
	  bfun = BITBLT_COPY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8169
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8170
	else if (aFunctionSymbol == @symbol(copyInverted)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8171
	  fun = R2_NOTCOPYPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8172
	  bfun = BITBLT_COPYINVERTED;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8173
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8174
	else if (aFunctionSymbol == @symbol(xor)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8175
	  fun = R2_XORPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8176
	  bfun = BITBLT_XOR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8177
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8178
	else if (aFunctionSymbol == @symbol(and)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8179
	  fun = R2_MASKPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8180
	  bfun = BITBLT_AND;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8181
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8182
	else if (aFunctionSymbol == @symbol(or)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8183
	  fun = R2_MERGEPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8184
	  bfun = BITBLT_OR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8185
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8186
	if (fun != -1) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8187
#if 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8188
	    printf("set func to");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8189
	    switch (bfun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8190
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8191
	      case BITBLT_COPY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8192
		printf("BITBLT_COPY\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8193
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8194
	      case BITBLT_COPYINVERTED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8195
		printf("BITBLT_COPYINVERTED\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8196
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8197
	      case BITBLT_XOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8198
		printf("BITBLT_XOR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8199
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8200
	      case BITBLT_AND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8201
		printf("BITBLT_AND\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8202
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8203
	      case BITBLT_OR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8204
		printf("BITBLT_OR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8205
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8206
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8207
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8208
	    gcData->rop2 = fun;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8209
	    gcData->bitbltrop2 = bfun;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8210
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8211
	else {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8212
	    if (@global(InfoPrinting) == true) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  8213
		__win32_fprintf(stderr, "WinWorkstat [warning]: unsuported Rasterfunction\n");
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8214
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8215
	    gcData->rop2 = R2_COPYPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8216
	    gcData->bitbltrop2 = BITBLT_COPY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8217
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8218
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8219
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8220
    else
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  8221
	printf("Rasterfunction no GC\n");
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8222
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8223
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8224
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8225
setGraphicsExposures:aBoolean in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8226
    "set or clear the graphics exposures flag"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8227
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8228
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8229
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8230
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8231
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8232
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8233
%{  /* xxLIMITEDSTACK (WIN95 only) */
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
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8236
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8237
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8238
     && __isSmallInteger(aNumber)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8239
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8240
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8241
	gcData->lineWidth = __intVal(aNumber);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8242
	if (lineStyle == @symbol(solid)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8243
	    gcData->lineStyle = PS_SOLID;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8244
	} else if (lineStyle == @symbol(dashed)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8245
	    gcData->lineStyle = PS_DASH;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8246
	} else
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8247
	    gcData->lineStyle = PS_SOLID;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8248
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8249
	if (capStyle == @symbol(round)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8250
	    gcData->capStyle = PS_ENDCAP_ROUND;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8251
	} else if (capStyle == @symbol(square)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8252
	    gcData->capStyle = PS_ENDCAP_SQUARE;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8253
	} else if (capStyle == @symbol(flat)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8254
	    gcData->capStyle = PS_ENDCAP_FLAT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8255
	} else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8256
	    gcData->capStyle = PS_ENDCAP_FLAT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8257
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8258
	if (joinStyle == @symbol(bevel)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8259
	    gcData->joinStyle = PS_JOIN_BEVEL;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8260
	} else if (joinStyle == @symbol(miter)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8261
	    gcData->joinStyle = PS_JOIN_MITER;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8262
	} else if (joinStyle == @symbol(round)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8263
	    gcData->joinStyle = PS_JOIN_ROUND;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8264
	} else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8265
	    gcData->joinStyle = PS_JOIN_MITER;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8266
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8267
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8268
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8269
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8270
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8271
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8272
setMaskOriginX:orgX y:orgY in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8273
    "set the mask origin"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8274
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8275
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8276
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8277
    if (__isExternalAddress(aGCId)) {
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  8278
	if (__bothSmallInteger(orgX,orgY)) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8279
	    struct gcData *gcData = _GCDATA(aGCId);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8280
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8281
	    gcData->maskOrgX = __intVal(orgX);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8282
	    gcData->maskOrgY = __intVal(orgY);;
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8283
	    RETURN (self);
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  8284
	}
2232
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
%}
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8289
setPixmapMask:aPixmapId in:aGCId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8290
    "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
  8291
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8292
%{  /* xxLIMITEDSTACK (WIN95 only) */
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8293
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8294
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8295
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8296
	if (__isExternalAddress(aPixmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8297
	    gcData->hMask = _HBITMAPVAL(aPixmapId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8298
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8299
	    gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8300
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8301
	DPRINTF(("PixmapMasks set to %x\n",gcData->hMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8302
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8303
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8304
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8305
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8306
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8307
!WinWorkstation methodsFor:'initialize / release'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8308
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8309
close
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8310
    "close down the connection to the X-server"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8311
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8312
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8313
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8314
initializeDefaultValues
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8315
    focusMode := #activeWindow.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8316
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8317
    buttonTranslation := ButtonTranslation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8318
    multiClickTimeDelta := MultiClickTimeDelta.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8319
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8320
    self initializeModifierMappings
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8321
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8322
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8323
initializeEventBuffer
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8324
    |sz|
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8325
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8326
%{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8327
    sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8328
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8329
    eventBuffer isNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8330
	eventBuffer := ByteArray new:sz.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8331
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8332
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8333
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8334
initializeFor:aDisplayName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8335
    "initialize the receiver for a connection to an X-Server;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8336
     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
  8337
     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
  8338
     as hostname:number"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8339
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8340
    displayId notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8341
	"/ already connected - trying to trick me ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8342
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8343
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8344
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8345
    displayId := self primInitializeFor:aDisplayName.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8346
    displayId isNil ifTrue:[^ self].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8347
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8348
    dispatching := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8349
    isSlow := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8350
    shiftDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8351
    ctrlDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8352
    metaDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8353
    altDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8354
    motionEventCompression := true.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8355
    buttonsPressed := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8356
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8357
    self initializeScreenProperties.
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8358
    self initializeDeviceResourceTables.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8359
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8360
    self initializeDefaultValues.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8361
    self initializeEventBuffer.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8362
    self initializeSpecialFlags.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8363
    self initializeKeyboardMap.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8364
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8365
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8366
initializeModifierMappings
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8367
    shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8368
    ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8369
    metaModifiers := #(#'Alt_L' #'Alt').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8370
    altModifiers := #(#'Alt_R').
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8371
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8372
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8373
initializeScreenProperties
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8374
    super initializeScreenProperties.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8375
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8376
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8377
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8378
    int scr;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8379
    int maxRGBDepth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8380
    int rgbRedMask, rgbGreenMask, rgbBlueMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8381
    int nvi, i, val, capabilities,__planes,__numcolors,__numpens,__ras;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8382
    char *type, *nm;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8383
    int dummy;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8384
    int mask, shift, nBits;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8385
    RECT rect;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8386
    HDC _rootDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8387
    OBJ id;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8388
    if (firstInstance)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8389
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8390
	OSVERSIONINFO osvi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8391
	WNDCLASS wc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8392
	firstInstance = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8393
	DPRINTF(("first create - registerClass\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8394
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8395
	memset(&osvi, 0, sizeof(OSVERSIONINFO));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8396
	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8397
	GetVersionEx (&osvi);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8398
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8399
	if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8400
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8401
	  __isWinNT = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8402
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8403
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8404
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8405
	  __isWinNT = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8406
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8407
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8408
	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
  8409
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8410
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8411
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8412
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8413
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8414
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8415
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8416
	wc.hbrBackground = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8417
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8418
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8419
	wc.lpszClassName = app_name;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8420
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8421
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8422
	    DPRINTF(("RegisterClass failed\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8423
    /*            return NULL;     */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8424
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8425
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8426
	wc.style = 0;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8427
	wc.lpfnWndProc = (WNDPROC) MainWndProc;// Root;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8428
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8429
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8430
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8431
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8432
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8433
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8434
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8435
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8436
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8437
	wc.lpszClassName = app_nameroot;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8438
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8439
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8440
	    DPRINTF(("RegisterClass failed\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8441
    /*            return NULL;     */
2000
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
	hCreateEvent = CreateEvent(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8444
	    NULL,        /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8445
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8446
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8447
	    THREADEVENTNAME);  /* name of mutex */
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 (hCreateEvent == NULL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8450
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8451
	    DPRINTF(("CreateEvent failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8452
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8453
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8454
	hInputEvent = CreateEvent(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8455
	    NULL,        /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8456
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8457
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8458
	    THREADINPUTEVENTNAME);  /* name of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8459
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8460
	if (hInputEvent == NULL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8461
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8462
	    DPRINTF(("InputEvent failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8463
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8464
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8465
	hdispatchMutex = CreateMutex(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8466
	    NULL,                       /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8467
	    FALSE,                      /* initially not owned */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8468
	    THREADMUTEXNAME);  /* name of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8469
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8470
	if (hdispatchMutex == NULL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8471
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8472
	    DPRINTF(("CreateMutex failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8473
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8474
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8475
	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
  8476
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8477
	/*__setWaitInputEvent(waitInputEvent);*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8478
	bdispatchThreadState = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8479
	_masterThreadId = GetCurrentThreadId();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8480
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8481
	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
  8482
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8483
	initqueue();
2284
c6490fd1f1f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2281
diff changeset
  8484
	__beginthread(dispatchThread, 4096, 0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8485
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8486
	  DWORD dwWaitResult;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8487
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8488
	  /* Request ownership of mutex. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8489
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8490
	  dwWaitResult = WaitForSingleObject(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8491
	    hCreateEvent,   /* handle of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8492
	    5000L);   /* time-out interval */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8493
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8494
    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8495
    multiClickTime = GetDoubleClickTime();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8496
    DPRINTF(("multiClickTime = %d\n",multiClickTime));
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8497
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8498
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8499
    __rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8500
    if (!__rootDesk)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8501
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8502
      PRINTF(("OpenDesktop fail\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8503
      __rootDesk = CreateDesktop ("Desktop0", NULL,NULL,0,DESKTOP_WRITEOBJECTS,NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8504
      if (!__rootDesk)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8505
      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8506
	PRINTF(("CreateDesktop fail\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8507
      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8508
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8509
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8510
    __rootWin = GetDesktopWindow();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8511
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8512
    id = __MKOBJ(__rootWin);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8513
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8514
    __INST(rootWin) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8515
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8516
    _rootDC = CreateDC("DISPLAY", NULL, NULL, NULL);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8517
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8518
    tmpDC = CreateCompatibleDC(_rootDC);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8519
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8520
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8521
    id = __MKOBJ(_rootDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8522
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8523
    __INST(rootDC) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8524
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8525
    GetWindowRect(__rootWin, &rect);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8526
    __INST(width) = __MKSMALLINT(rect.right-rect.left);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8527
    __INST(height) = __MKSMALLINT(rect.bottom-rect.top);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8528
    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
  8529
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8530
    __planes = GetDeviceCaps(_rootDC, PLANES);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8531
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8532
#ifndef ALWAYSTRUECOLOR
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8533
    __depth = GetDeviceCaps(_rootDC, BITSPIXEL);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8534
#else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8535
    __depth = 24;  /* its a hack */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8536
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8537
    if (__depth == 15)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8538
      __depth = 16;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8539
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8540
#if 0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8541
    __numcolors = GetDeviceCaps(_rootDC, NUMCOLORS);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8542
    __numpens = GetDeviceCaps(_rootDC, NUMPENS);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8543
    DPRINTF(("screen has %d planes\n",__planes));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8544
    DPRINTF(("numcolors is %d\n",__numcolors));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8545
    DPRINTF(("numpens is %d\n",__numpens));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8546
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8547
    __ras = GetDeviceCaps(_rootDC, RASTERCAPS);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8548
#if 0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8549
    printf("device support:\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8550
    if (__ras & RC_BANDING)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8551
      printf(" RC_BANDING");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8552
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8553
    if (__ras & RC_BITBLT)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8554
      printf(" RC_BITBLT");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8555
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8556
    if (__ras & RC_BITMAP64)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8557
      printf(" RC_BITMAP64");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8558
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8559
    if (__ras & RC_DI_BITMAP)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8560
      printf(" RC_DI_BITMAP");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8561
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8562
    if (__ras & RC_DIBTODEV)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8563
      printf(" RC_DIBTODEV");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8564
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8565
    if (__ras & RC_FLOODFILL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8566
      printf(" RC_FLOODFILL");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8567
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8568
    if (__ras & RC_PALETTE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8569
      printf(" RC_PALETTE");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8570
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8571
    if (__ras & RC_SCALING)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8572
      printf(" RC_SCALING");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8573
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8574
    if (__ras & RC_STRETCHBLT)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8575
      printf(" RC_STRETCHBLT");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8576
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8577
    if (__ras & RC_STRETCHDIB)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8578
      printf(" RC_STRETCHDIB");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8579
    printf("\n");
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8580
    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
  8581
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8582
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8583
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8584
    __INST(depth) = __MKSMALLINT(__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8585
    __INST(ncells) = __MKSMALLINT(1<<__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8586
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8587
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8588
    val = GetDeviceCaps(_rootDC, HORZSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8589
    DPRINTF(("HORSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8590
    __INST(widthMM) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8591
    val = GetDeviceCaps(_rootDC, VERTSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8592
    DPRINTF(("VERTSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8593
    __INST(heightMM) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8594
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8595
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8596
    __logPixelSY = GetDeviceCaps(_rootDC, LOGPIXELSY);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8597
    capabilities = GetDeviceCaps(_rootDC, RASTERCAPS);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8598
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8599
    __INST(whitepixel) = __MKSMALLINT(WhitePixel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8600
    __INST(blackpixel) = __MKSMALLINT(BlackPixel);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8601
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8602
#ifndef ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8603
    if (! (capabilities & RC_PALETTE))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8604
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8605
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8606
	DPRINTF(("no palette\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8607
	if (__depth == 1) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8608
	    __INST(visualType) = @symbol(GrayScale);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8609
	    __INST(hasColors) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8610
	    __INST(hasGreyscales) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8611
	    __INST(monitorType) = @symbol(monochrome);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8612
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8613
	    __INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8614
	    __INST(hasGreyscales) = true;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8615
	    if ((__depth == 16) || (__depth == 15))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8616
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8617
	      __INST(visualType) = @symbol(TrueColor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8618
	      __INST(blueShift) = __MKSMALLINT(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8619
	      __INST(greenShift) = __MKSMALLINT(5);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8620
	      __INST(redShift) = __MKSMALLINT(11);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8621
	      __INST(bitsPerRGB) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8622
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8623
	      __INST(blueMask) = __MKSMALLINT(0x1f);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8624
	      __INST(greenMask) = __MKSMALLINT(0x7e0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8625
	      __INST(redMask) = __MKSMALLINT(0xf800);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8626
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8627
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8628
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8629
	      __INST(visualType) = @symbol(TrueColor);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8630
	      __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8631
	      __INST(greenShift) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8632
	      __INST(blueShift) = __MKSMALLINT(16);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8633
	      __INST(bitsPerRGB) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8634
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8635
	      __INST(redMask) = __MKSMALLINT(0xFF);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8636
	      __INST(greenMask) = __MKSMALLINT(0xFF00);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8637
	      __INST(blueMask) = __MKSMALLINT(0xFF0000);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8638
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8639
	}
2232
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
#ifndef ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8642
    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8643
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8644
	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
  8645
	printf("SizeofPalette %d\n",val);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8646
	__INST(ncells) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8647
	__INST(blackpixel) = __MKSMALLINT(0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8648
	__INST(whitepixel) = __MKSMALLINT(1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8649
	__INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8650
	__INST(hasGreyscales) = true;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8651
	__INST(usingSystemPalette) = true;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8652
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8653
	  __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8654
	  __INST(greenShift) = __MKSMALLINT(2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8655
	  __INST(blueShift) = __MKSMALLINT(4);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8656
	  __INST(bitsPerRGB) = __MKSMALLINT(2);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8657
	  __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8658
	  __INST(redMask) = __MKSMALLINT(0x3);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8659
	  __INST(greenMask) = __MKSMALLINT(0xc);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8660
	  __INST(blueMask) = __MKSMALLINT(0x30);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8661
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8662
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8663
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8664
    __INST(monitorType) = @symbol(unknown);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8665
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8666
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8667
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8668
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8669
initializeSpecialFlags
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8670
    "perform additional special server implementation flags"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8671
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8672
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8673
primInitializeFor:aDisplayName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8674
    "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
  8675
     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
  8676
     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
  8677
     as hostname:number"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8678
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8679
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8680
    RETURN ( __MKSMALLINT(1) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8681
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8682
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8683
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8684
reinitialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8685
    rootWin := rootDC := nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8686
    super reinitialize.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8687
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8688
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8689
!WinWorkstation methodsFor:'keyboard mapping'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8690
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8691
altModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8692
    "return the mask (in motionEvents) for the alt-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8693
     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
  8694
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8695
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8696
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8697
    RETURN (__MKSMALLINT(AltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8698
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8699
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8700
    "Created: 23.3.1996 / 12:43:22 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8701
    "Modified: 23.3.1996 / 12:44:56 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8702
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8703
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8704
leftAltMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8705
    "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
  8706
     See comment in altModifierMask: / metaModifierMask: for what
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8707
     this could be used."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8708
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8709
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8710
    RETURN (__MKSMALLINT(LeftAltMask));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8714
metaModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8715
    "return the mask (in motionEvents) for the meta-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8716
     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
  8717
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8718
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8719
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8720
    RETURN (__MKSMALLINT(MetaMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8721
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8722
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8723
    "Created: 23.3.1996 / 12:43:39 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8724
    "Modified: 23.3.1996 / 12:45:09 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8725
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8726
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8727
modifierMapping
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8728
    "Get the Modifier Mapping.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8729
     We return an array of arrays of keycodes"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8730
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8731
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8732
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8733
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8734
rightAltMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8735
    "return the mask bit for the right Alt modifier key.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8736
     See comment in altModifierMask: / metaModifierMask: for what
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8737
     this could be used."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8738
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8739
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8740
    RETURN (__MKSMALLINT(RightAltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8741
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8742
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8743
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8744
stringFromKeycode:code
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8745
    "Get a KeySymbol (a smalltalk symbol) from the keycode."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8746
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8747
    ^ ''
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
	Display stringFromKeycode:28
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8751
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8752
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8753
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8754
!WinWorkstation methodsFor:'misc'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8755
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8756
beep
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8757
    "output an audible beep"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8758
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  8759
%{  
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  8760
    __STX_API_CALL1(
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  8761
	MessageBeep, MB_ICONEXCLAMATION
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  8762
    );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8763
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8764
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8765
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8766
flush
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8767
    "send all buffered drawing to the display.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8768
     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
  8769
     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
  8770
     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
  8771
     (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
  8772
     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
  8773
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8774
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8775
     GdiFlush();
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8776
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8777
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8778
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8779
refreshKeyboardMapping:eB
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8780
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8781
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8782
setInputFocusTo:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8783
    self setInputFocusTo:aWindowId revertTo:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8784
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8785
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8786
setInputFocusTo:aWindowId revertTo:revertSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8787
    "set the focus to the view as defined by aWindowId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8788
     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
  8789
     input until a new focus is set.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8790
     RevertSymbol specifies what should happen if the view becomes invisible;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8791
     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
  8792
     given to the parent view, the root view or no view."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8793
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8794
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8795
    if (__isExternalAddress(aWindowId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8796
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8797
	HWND hWnd = _HWNDVal(aWindowId);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8798
	int r = 0;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8799
	if (revertSymbol == @symbol(parent)) 
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8800
	{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8801
	  r = 1;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8802
	}
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8803
	else if (revertSymbol == @symbol(root)) 
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8804
	{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8805
	  r = 2;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8806
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8807
	if (hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8808
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8809
	    if (GetFocus() != hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8810
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8811
	      CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8812
	      PostMessage(hWnd,WM_THREADSETFOCUS,(INT)hWnd,GetCurrentThreadId());
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8813
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8814
	      if (SetFocus(hWnd) == 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8815
	       PRINTF(("SetFocus to %x failed.\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8816
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8817
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8818
	    else
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8819
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8820
	      CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8821
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8822
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8823
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8824
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8825
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8826
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8827
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8828
!WinWorkstation methodsFor:'pointer queries '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8829
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8830
anyButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8831
    "return an integer for masking out any button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8832
     buttonStates value."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8833
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8834
    "/ should use ``Display buttonXMotionMask bitOr:....''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8835
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8836
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8837
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8838
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8839
    s = __MKSMALLINT(Button1Mask|Button2Mask|Button3Mask);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8840
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8841
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8842
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8843
    "Modified: 23.3.1996 / 12:41:33 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8844
    "Created: 23.3.1996 / 12:46:35 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8845
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8846
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8847
buttonStates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8848
    "return an integer representing the state of the pointer buttons;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8849
     a one-bit in positions 0.. represent a pressed button.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8850
     See the button1Mask/button2Mask/button3Mask,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8851
     shiftMask/controlMask and modifierMask methods for the meaning of the bits."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8852
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8853
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8854
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8855
%{
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8856
    int modifiers = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8857
    int b1m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8858
    int b3m = Button3Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8859
    if (GetSystemMetrics(SM_SWAPBUTTON))
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8860
    {
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8861
      b3m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8862
      b1m = Button3Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8863
    }
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8864
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8865
    if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8866
	modifiers |= b1m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8867
    if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8868
	modifiers |= Button2Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8869
    if (GetAsyncKeyState(VK_RBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8870
	modifiers |= b3m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8871
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8872
    s = __MKSMALLINT(modifiers);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8873
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8874
    ^ s
1127
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
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8877
     Display buttonStates
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8878
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8879
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8880
    "is the control-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8881
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8882
     Display buttonStates bitTest:(Display controlMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8883
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8884
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8885
    "is the alt/meta-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8886
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8887
     Display buttonStates bitTest:(Display altModifierMask)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8888
     Display buttonStates bitTest:(Display metaModifierMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8889
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8890
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8891
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8892
leftButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8893
    "return an integer for masking out the left button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8894
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8895
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8896
    "/ should use ``Display button1MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8897
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8898
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8899
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8900
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8901
    s = __MKSMALLINT(Button1Mask);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8902
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8903
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8904
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8905
    "Modified: 23.3.1996 / 12:41:33 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8906
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8907
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8908
middleButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8909
    "return an integer for masking out the middle button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8910
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8911
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8912
    "/ should use ``Display button2MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8913
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8914
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8915
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
    s = __MKSMALLINT(Button2Mask);
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
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8920
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8921
    "Modified: 23.3.1996 / 12:41:43 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8922
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8923
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8924
pointerPosition
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8925
    "return the current pointer position in root-window coordinates"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8926
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8927
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8928
    POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8929
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8930
    if (GetCursorPos(&p)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8931
	RETURN (__MKPOINT_INT(p.x, p.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8932
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8933
    RETURN (__MKPOINT_INT(0, 0));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8934
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8935
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8936
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8937
rightButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8938
    "return an integer for masking out the right button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8939
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8940
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8941
    "/ should use ``Display button3MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8942
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8943
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8944
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8945
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8946
    s = __MKSMALLINT(Button3Mask);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8947
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8948
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8949
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8950
    "Modified: 23.3.1996 / 12:41:52 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8951
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8952
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8953
rootPositionOfLastEvent
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8954
    "return the position in root-window coordinates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8955
     of the last button, key or pointer event"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8956
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8957
    |x y|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8958
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8959
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8960
    x = __MKSMALLINT(evRootX);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8961
    y = __MKSMALLINT(evRootY);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8962
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8963
    ^ x @ y
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8964
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8965
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8966
setPointerPosition:newPosition
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8967
    "change the pointer position in root-window coordinates."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8968
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8969
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8970
    if (__isPoint(newPosition)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8971
	OBJ xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8972
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8973
	xpos = __point_X(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8974
	ypos = __point_Y(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8975
	SetCursorPos(__intVal(xpos), __intVal(ypos));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8976
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8977
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8978
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8979
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8980
setPointerPosition:newPosition in:aWindowId
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8981
    "change the pointer position to a new position relative to the
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8982
     given windows origin (which may be the rootWindow).
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8983
     Be careful with this - its usually not very ergonimically
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8984
     to change the mousePointer position.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8985
     This interface is provided for special applications (presentation
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8986
     playback) and should not be used in normal applications."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8987
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8988
    self setCursorPosition:(self translatePoint:newPosition from:aWindowId to:rootView id).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8989
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8990
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8991
!WinWorkstation methodsFor:'retrieving pixels'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8992
1461
6d8b022bfcd8 renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
  8993
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
  8994
    "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
  8995
     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
  8996
     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
  8997
     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
  8998
     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
  8999
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9000
    |rawInfo info|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9001
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9002
    ((w <= 0) or:[h <= 0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9003
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9004
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9005
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9006
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9007
    rawInfo := Array new:8.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9008
		  "1 -> bit order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9009
		  "2 -> depth"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9010
		  "3 -> bytes_per_line"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9011
		  "4 -> byte_order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9012
		  "5 -> format"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9013
		  "6 -> bitmap_unit"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9014
		  "7 -> bitmap_pad"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9015
		  "8 -> bits_per_pixel"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9016
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9017
    "/ 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
  9018
    "/ unlimitedStack (some implementations use alloca and require huge amounts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9019
    "/ of temporary stack space
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9020
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9021
    (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
  9022
	info := IdentityDictionary new.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9023
	info at:#bitOrder put:(rawInfo at:1).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9024
	info at:#depth put:(rawInfo at:2).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9025
	info at:#bytesPerLine put:(rawInfo at:3).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9026
	info at:#byteOrder put:(rawInfo at:4).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9027
	info at:#format put:(rawInfo at:5).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9028
	info at:#bitmapUnit put:(rawInfo at:6).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9029
	info at:#bitmapPad put:(rawInfo at:7).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9030
	info at:#bitsPerPixel put:(rawInfo at:8).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9031
	^ info
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9032
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9033
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9034
     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
  9035
     or is too small to hold the bits
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9036
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9037
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9038
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9039
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9040
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
  9041
    "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
  9042
     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
  9043
     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
  9044
     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
  9045
     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
  9046
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9047
    |rawInfo info|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9048
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9049
    ((w <= 0) or:[h <= 0]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9050
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9051
	^ nil
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9052
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9053
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9054
    rawInfo := Array new:8.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9055
		  "1 -> bit order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9056
		  "2 -> depth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9057
		  "3 -> bytes_per_line"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9058
		  "4 -> byte_order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9059
		  "5 -> format"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9060
		  "6 -> bitmap_unit"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9061
		  "7 -> bitmap_pad"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9062
		  "8 -> bits_per_pixel"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9063
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9064
    "/ 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
  9065
    "/ 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
  9066
    "/ of temporary stack space
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9067
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9068
    (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
  9069
	info := IdentityDictionary new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9070
	info at:#bitOrder put:(rawInfo at:1).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9071
	info at:#depth put:(rawInfo at:2).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9072
	info at:#bytesPerLine put:(rawInfo at:3).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9073
	info at:#byteOrder put:(rawInfo at:4).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9074
	info at:#format put:(rawInfo at:5).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9075
	info at:#bitmapUnit put:(rawInfo at:6).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9076
	info at:#bitmapPad put:(rawInfo at:7).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9077
	info at:#bitsPerPixel put:(rawInfo at:8).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9078
	^ info
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
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9081
     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
  9082
     or is too small to hold the bits
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9083
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9084
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9085
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9086
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9087
getPixelX:x y:y from:aDrawableId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9088
    "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
  9089
     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
  9090
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9091
    'getPixelX:y:from: not yet implemented' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9092
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9093
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9094
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9095
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
  9096
    "since XGetImage may allocate huge amount of stack space
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9097
     (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
  9098
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9099
    "'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
  9100
    ^ false"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9101
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9102
    int            height, width;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9103
    int            numBytes;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9104
    HWND        hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9105
    HBITMAP hBitmap = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9106
    HDC bDC = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9107
    struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9108
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9109
      BITMAPINFOHEADER bmiHeader;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9110
      DWORD r;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9111
      DWORD g;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9112
      DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9113
    } bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9114
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9115
    if (__isExternalAddress(aDrawableId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9116
     && __bothSmallInteger(srcX, srcY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9117
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9118
     && __isArray(info)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9119
     && __isByteArray(imageBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9120
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9121
	hWnd = _HWNDVal( aDrawableId );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9122
	DPRINTF(("primGetBits %x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9123
	if( hWnd != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9124
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9125
	    HDC wDC = GetDC(hWnd);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9126
	    bDC = CreateCompatibleDC(__rootDC);
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  9127
	    PRINTF(("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
  9128
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9129
	    width  =  __intVal(w);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9130
	    DPRINTF(("width %d height %d\n",width,height));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  9131
	    hBitmap = CreateCompatibleBitmap(__rootDC,(width + 3 )/ 4 * 4 /*width*/,height);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9132
	    if (!hBitmap)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9133
	      goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9134
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9135
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9136
	    bitmap.bmiHeader.biPlanes = 1;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9137
	    if (__depth == 24)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9138
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9139
	      bitmap.bmiHeader.biCompression = BI_RGB;
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
	    else if (__depth == 16)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9142
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9143
	      /*bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9144
	      bitmap.bmiHeader.biCompression = BI_BITFIELDS;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9145
	      bitmap.b = 0x001f;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9146
	      bitmap.g = 0x07e0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9147
	      bitmap.r = 0xf800;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9148
	      bitmap.b = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9149
	      bitmap.g = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9150
	      bitmap.r = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9151
	      bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9152
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9153
	    bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9154
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9155
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9156
	    bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9157
	    bitmap.bmiHeader.biClrImportant = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9158
	    bitmap.bmiHeader.biBitCount = __depth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9159
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  9160
	    bitmap.bmiHeader.biWidth = (width + 3 )/ 4 * 4; // width;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9161
	    bitmap.bmiHeader.biHeight = -height;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9162
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9163
	    SelectObject(bDC,hBitmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9164
	    if (BitBlt(bDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9165
		   0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9166
		   width,height,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9167
		   wDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9168
		   __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9169
		   SRCCOPY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9170
		 == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9171
		)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9172
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9173
	       printf("ERROR in GetBitsFrom: BitBlt\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9174
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9175
	    ReleaseDC(hWnd,wDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9176
	    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
  9177
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9178
		printf("noinfo returned\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9179
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9180
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9181
	    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
  9182
	    numBytes = bitmap.bmiHeader.biSizeImage;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9183
	    if( numBytes != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9184
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9185
	      if (numBytes > __byteArraySize(imageBits)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9186
		  /* imageBits too small */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9187
		  printf("provided byteArray too small\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9188
		  goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9189
	      }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9190
	      DPRINTF(("numBytes %d\n",numBytes));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9191
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9192
	      bitmap.bmiHeader.biHeight = -height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9193
	      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
  9194
	      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9195
		  printf("zero bits returned\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9196
		  goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9197
	      }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9198
	      else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9199
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9200
		char *c = __ByteArrayInstPtr(imageBits)->ba_element;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9201
		int n = numBytes;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9202
		for (;n > 0;n -= 3,c += 3)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9203
		{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9204
		  char b = c[0];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9205
		  c[0] = c[2];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9206
		  c[2] = b;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9207
		}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9208
	      }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9209
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9210
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9211
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9212
		printf("unacceptable bitmap\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9213
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9214
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9215
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9216
	else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9217
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9218
	    printf("unacceptable bitmap\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9219
	    goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9220
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9221
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9222
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9223
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9224
	__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
  9225
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9226
	__ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9227
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9228
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9229
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9230
	if (bDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9231
	  DeleteDC(bDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9232
	if (hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9233
	  DelObject(hBitmap);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9234
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9235
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9236
fail:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9237
    if (bDC)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9238
      DeleteDC(bDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9239
    if (hBitmap)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9240
      DelObject(hBitmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9241
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9242
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9243
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9244
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9245
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9246
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
  9247
    "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
  9248
     (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
  9249
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9250
%{  /* xxLIMITEDSTACK */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9251
    int            height, width;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9252
    int            numBytes;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9253
    unsigned char* ep = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9254
    HBITMAP        xBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9255
    HBITMAP hBitmap = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9256
    HDC bDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9257
    HDC xDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9258
    struct
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9259
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9260
      BITMAPINFOHEADER bmiHeader;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9261
      DWORD rgb[2];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9262
    } bitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9263
    BITMAP bitmapInfo;
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
    if (__isExternalAddress(aDrawableId)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9266
     && __bothSmallInteger(srcX, srcY)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9267
     && __bothSmallInteger(w, h)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9268
     && __isArray(info)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9269
     && __isByteArray(imageBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9270
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9271
	xBitmap = _HBITMAPVAL( aDrawableId );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9272
	DPRINTF(("primGetBitsFromPixmap %x\n",xBitmap));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9273
	if( xBitmap != 0 )
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9274
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9275
	    xDC = GetDC(0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9276
	    SelectObject(xDC,xBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9277
	    GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9278
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9279
	    bDC = CreateCompatibleDC(__rootDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9280
	    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
  9281
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9282
	    width  =  __intVal(w);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9283
	    DPRINTF(("width %d height %d\n",width,height));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9284
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9285
	    hBitmap = CreateCompatibleBitmap(xDC,width,height);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9286
	    if (!hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9287
	      goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9288
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9289
	    SelectObject(bDC,hBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9290
	    if (BitBlt(bDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9291
		   0,0,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9292
		   width,height,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9293
		   xDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9294
		   __intVal(srcX), __intVal(srcY),
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9295
		   SRCCOPY)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9296
		 == 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9297
		)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9298
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9299
	       DPRINTF(("ERROR in primGetBitsFromPixmap: BitBlt\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9300
	       goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9301
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9302
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9303
	    bitmap.bmiHeader.biPlanes = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9304
	    if (__depth == 24)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9305
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9306
	      /*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9307
	      bitmap.r = 0xff0000;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9308
	      bitmap.g = 0x00ff00;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9309
	      bitmap.b = 0x0000ff;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9310
	      bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9311
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9312
	    else if (__depth == 16)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9313
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9314
	      /*bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9315
	      bitmap.bmiHeader.biCompression = BI_BITFIELDS;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9316
	      bitmap.b = 0x001f;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9317
	      bitmap.g = 0x07e0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9318
	      bitmap.r = 0xf800;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9319
	      bitmap.bmiHeader.biCompression = BI_RGB;
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
	    bitmap.bmiHeader.biSizeImage = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9322
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9323
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9324
	    bitmap.bmiHeader.biClrUsed = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9325
	    bitmap.bmiHeader.biClrImportant = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9326
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9327
	    bitmap.bmiHeader.biWidth = width;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9328
	    bitmap.bmiHeader.biHeight = -height;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9329
	    bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9330
/* XXX - this seems to overwrite by stack frame ....
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9331
 * check args
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9332
 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9333
	    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
  9334
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9335
		DPRINTF(("noinfo returned\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9336
		goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9337
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9338
	    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
  9339
	    numBytes = bitmap.bmiHeader.biSizeImage;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9340
	    if( numBytes != 0 )
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9341
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9342
	      if (numBytes > __byteArraySize(imageBits)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9343
		  /* imageBits too small */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9344
		  DPRINTF(("provided byteArray too small\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9345
		  goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9346
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9347
	      DPRINTF(("numBytes %d\n",numBytes));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9348
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9349
	      bitmap.bmiHeader.biHeight = -height;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9350
	      bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9351
	      bitmap.rgb[0] = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9352
	      bitmap.rgb[1] = 0xffffff;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9353
	      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
  9354
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9355
		DPRINTF(("zero bits returned\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9356
		goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9357
	      }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9358
	    }
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9359
	    else
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9360
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9361
		DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9362
		goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9363
	    }
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9364
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9365
	else
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9366
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9367
	    DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9368
	    goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9369
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9370
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9371
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9372
	__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
  9373
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9374
	__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
  9375
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9376
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9377
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9378
	if (bDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9379
	  DeleteDC(bDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9380
	if (xDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9381
	  ReleaseDC(0,xDC);//DeleteDC(xDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9382
	if (hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9383
	  DelObject(hBitmap);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9384
	RETURN ( true );
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9385
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9386
fail:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9387
    if (bDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9388
      DeleteDC(bDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9389
    if (xDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9390
      ReleaseDC(0,xDC);//DeleteDC(xDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9391
    if (hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9392
      DelObject(hBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9393
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9394
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9395
    ^ false
2232
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9398
!WinWorkstation methodsFor:'selections'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9399
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9400
getClipboardData
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9401
%{
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9402
    HANDLE hClip;
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9403
    HANDLE hData;
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9404
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9405
    hClip = OpenClipboard(NULL);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9406
    hData = GetClipboardData(CF_TEXT);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9407
    CloseClipboard();
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9408
printf("%s\n", (char *)hData);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9409
%}
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9410
!
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9411
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9412
getSelectionFor:drawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9413
    'getSelectionFor: not yet implemented' errorPrintCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9414
    ^ nil
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9415
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9416
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9417
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9418
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9419
!WinWorkstation methodsFor:'style defaults'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9420
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9421
defaultStyleValueFor:aKey
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9422
    "return a default style value, given a key.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9423
     These defaults are used if nothing is specified
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9424
     in the style sheet
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9425
     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
  9426
     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
  9427
     where the systemDefaults are used ..."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9428
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9429
    <resource: #style (#viewSpacing
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9430
		       #borderColor #borderWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9431
		       #viewBackground #shadowColor #lightColor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9432
		      )>
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9433
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9434
    |clr|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9435
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9436
"/    aKey == #shadowColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9437
"/        ^ Color black
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
"/    aKey == #lightColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9440
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9441
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9442
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9443
    aKey == #viewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9444
	clr := self getSystemColor:#COLOR_WINDOW.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9445
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9446
    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9447
	clr := self getSystemColor:#COLOR_WINDOWTEXT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9448
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9449
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9450
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9451
"/    aKey == #scrollerViewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9452
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9453
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9454
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9455
"/    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9456
"/        ^ Color black.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9457
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9458
"/    aKey == #textBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9459
"/        ^ Color white.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9460
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9461
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9462
    clr notNil ifTrue:[^ clr].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9463
    ^ super defaultStyleValueFor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9464
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9465
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9466
!WinWorkstation methodsFor:'window stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9467
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9468
clearRectangleX:x y:y width:width height:height in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9469
    "clear a rectangular area to viewbackground"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9470
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9471
    DPRINTF(("clearRect\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9472
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9473
    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
  9474
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9475
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9476
clearWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9477
    "clear a window to viewbackground"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9478
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9479
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9480
    DPRINTF(("clearWin\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9481
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9482
    super clearWindow:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9483
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9484
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9485
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9486
    "configure stacking operation of aWindowId w.r.t siblingId"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9487
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9488
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9489
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9490
lowerWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9491
    "bring a window to back"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9492
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9493
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9494
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9495
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9496
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9497
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9498
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9499
	{
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9500
	    CPRINTF(("lowerWindow %x\n",win));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9501
	    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
  9502
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9503
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9504
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9505
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9506
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9507
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9508
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
  9509
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9510
    "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
  9511
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9512
    "/ 'mapView:id:iconified:...height: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9513
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9514
    RECT rec;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9515
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9516
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9517
     && __bothSmallInteger(w, h)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9518
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9519
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9520
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9521
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9522
	    rec.left = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9523
	    rec.top = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9524
	    rec.right = rec.left + __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9525
	    rec.bottom = rec.top + __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9526
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9527
	    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
  9528
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9529
	    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
  9530
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9531
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9532
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9533
			 rec.right - rec.left, rec.bottom - rec.top,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9534
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOZORDER|SWP_NOOWNERZORDER);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9535
	    if (aBoolean == true)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9536
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9537
	      ShowWindow(win, SW_SHOWMINIMIZED);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9538
	      enqEvent(0,win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9539
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9540
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9541
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9542
	      enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9543
	      //ShowWindow(win, SW_RESTORE);
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9544
	      ShowWindow(win, SW_SHOWNOACTIVATE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9545
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9546
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9547
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9548
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9549
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9550
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9551
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9552
mapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9553
    "make a window visible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9554
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9555
%{  /* xxLIMITEDSTACK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9556
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9557
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9558
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9559
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9560
	if (win) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9561
	    CPRINTF(("mapWindow %x\n",win));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9562
	    ShowWindow(win, SW_SHOWNOACTIVATE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9563
	    //ShowWindow(win, SW_SHOW);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9564
	    SetWindowPos(win, HWND_TOP, 0, 0, 0, 0, SWP_NOSENDCHANGING|/*SWP_SHOWWINDOW|*/SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE/*|SWP_NOZORDER|SWP_NOOWNERZORDER */      );
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9565
	    //enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9566
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9567
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9568
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9569
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9570
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9571
2251
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9572
activateWindow:aWindowId
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9573
    "make a window active"
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9574
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9575
%{  /* xxLIMITEDSTACK */
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9576
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9577
    if (__isExternalAddress(aWindowId)) {
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9578
	HWND win = _HWNDVal(aWindowId);
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9579
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9580
	if (win) {
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9581
	    CPRINTF(("activateWindow %x\n",win));
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9582
	    ShowWindowAsync(win, SW_SHOW | SW_SHOWNORMAL);
2251
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9583
	    //ShowWindow(win, SW_SHOW);
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9584
	    //SetWindowPos(_thread_newWinHandle, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW|/*SWP_NOACTIVATE|*/SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER);
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9585
	    //enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9586
	}
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9587
	RETURN ( self );
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9588
    }
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9589
%}
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9590
!
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9591
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9592
moveResizeWindow:aWindowId x:x y:y width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9593
    "move and resize a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9594
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9595
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9596
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9597
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9598
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9599
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9600
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9601
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9602
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9603
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9604
	    rec.left = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9605
	    rec.top = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9606
	    rec.right = rec.left + __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9607
	    rec.bottom = rec.top + __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9608
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9609
	    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
  9610
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9611
	    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
  9612
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9613
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9614
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9615
			 rec.right - rec.left, rec.bottom - rec.top,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9616
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOZORDER|SWP_NOOWNERZORDER);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9617
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9618
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9619
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9620
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9621
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9622
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9623
moveWindow:aWindowId x:x y:y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9624
    "move a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9625
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9626
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9627
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9628
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9629
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9630
     && __bothSmallInteger(x, y)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9631
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9632
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9633
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9634
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9635
	    rec.left = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9636
	    rec.top = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9637
	    rec.right = rec.left + 10;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9638
	    rec.bottom = rec.top + 10;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9639
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9640
	    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
  9641
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9642
	    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
  9643
	    SetWindowPos(win, (HWND)0,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9644
			 rec.left, rec.top,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9645
			 0, 0,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9646
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER|SWP_NOOWNERZORDER);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9647
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9648
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9649
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9650
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9651
!
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
primSetWindowIconId:wiconId width:wiconWidth height:wiconHeight in:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9654
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9655
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9656
    unsigned char* cp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9657
    unsigned char* ep;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9658
    HBITMAP        xBitMap, maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9659
    ICONINFO       iconInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9660
    int            height, width;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9661
    int            nBytes, nBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9662
    int            index;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9663
    HICON          xIcon = (HICON)0, yIcon = (HICON)0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9664
    unsigned char *allocatedBits = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9665
    unsigned char fastBits[10000];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9666
    DPRINTF(("primSetWindowIconId\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9667
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9668
     && __isExternalAddress(wiconId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9669
     && __bothSmallInteger(wiconWidth, wiconHeight))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9670
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9671
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9672
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9673
	xBitMap = _HBITMAPVAL( wiconId );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9674
	if( xBitMap != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9675
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9676
	  BITMAP bm;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9677
	  if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9678
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9679
	    int d = bm.bmPlanes * bm.bmBitsPixel;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9680
	    BYTE *ep,*bp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9681
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9682
	    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
  9683
	    height = __intVal( wiconHeight );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9684
	    width  = __intVal( wiconWidth  );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9685
	    nBytes = ( width + 31 ) / 8;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9686
	    nBytes = height * nBytes;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9687
	    if (nBytes < sizeof(fastBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9688
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9689
		ep = fastBits;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9690
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9691
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9692
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9693
		ep = allocatedBits = (unsigned char *) malloc(nBytes);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9694
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9695
	    if( ep != 0 ) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9696
		memset(ep,0,nBytes);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9697
		maskBitmap = CreateBitmap(width, height, 1, 1, ep );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9698
		if( maskBitmap != NULL ) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9699
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9700
		    iconInfo.fIcon = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9701
		    iconInfo.hbmMask  =maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9702
		    iconInfo.hbmColor = xBitMap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9703
		    xIcon = CreateIconIndirect( &iconInfo );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9704
		    DPRINTF(( "ICON CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9705
		    DelObject( maskBitmap );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9706
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9707
		    DPRINTF(( "BITMAP mask CREATION failed!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9708
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9709
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9710
		PRINTF(( " malloc failed\n" ));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9711
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9712
	    if (allocatedBits)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9713
		free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9714
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9715
	} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9716
	    DPRINTF((" xBitMap is zero \n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9717
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9718
	if (xIcon) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9719
#ifndef TOPWINDOWCLASS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9720
	   yIcon = (HICON)GetClassLong(win,GCL_HICON);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9721
	   SetClassLong(win,GCL_HICON,(DWORD)xIcon);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9722
/* 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
  9723
	    if( yIcon ) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9724
		if( DestroyIcon( yIcon ) )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9725
		    DPRINTF(( "Old icon deleted\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9726
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9727
#else
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9728
	    SendMessage(_thread_newWinHandle,WM_SETICON,ICON_SMALL,(LPARAM)xIcon);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9729
	    SendMessage(_thread_newWinHandle,WM_SETICON,ICON_BIG,(LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9730
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9731
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9732
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9733
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9734
%}
2232
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
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9737
raiseWindow:aWindowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9738
    "bring a window to front"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9739
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9740
%{  /* xxLIMITEDSTACK (WIN95 only) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9741
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9742
    if (__isExternalAddress(aWindowId)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9743
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9744
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9745
	if (hWnd) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9746
	    CPRINTF(("raiseWindow %x\n",hWnd));
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9747
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, /*SWP_NOOWNERZORDER  |*/SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOMOVE|SWP_NOSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9748
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9749
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9750
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9751
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9752
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9753
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9754
resizeWindow:aWindowId width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9755
    "resize a window"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9756
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9757
%{  /* xxLIMITEDSTACK (WIN95 only) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9758
    RECT rec;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9759
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9760
     && __bothSmallInteger(w, h)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9761
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9762
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9763
	if (hWnd)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9764
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9765
	    rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9766
	    rec.top = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9767
	    rec.right = __intVal(w);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9768
	    rec.bottom = __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9769
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9770
	    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
  9771
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9772
	    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
  9773
	    SetWindowPos(hWnd, (HWND)0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9774
			 0, 0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9775
			 rec.right - rec.left, rec.bottom - rec.top,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9776
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER|SWP_NOOWNERZORDER);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9777
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9778
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9779
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9780
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9781
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9782
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9783
setBackingStore:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9784
    "turn on/off backing-store for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9785
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9786
    'setBackingStore:in: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9787
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9788
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9789
setBitGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9790
    "set bit gravity for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9791
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9792
    "/ 'setBitGravity:in: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9793
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9794
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9795
setCursor:aCursorId in:aWindowId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9796
    "define a windows cursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9797
     Ignored here, since in windows, an application
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9798
     has to manage the cursor itself."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9799
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9800
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9801
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9802
    HCURSOR newCursor;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9803
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9804
    if (ISCONNECTED
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9805
     && __isExternalAddress(aWindowId)
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9806
     && __isExternalAddress(aCursorId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9807
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9808
	POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9809
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  9810
	/*printf("setCursor:in:\n");*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9811
	SetWindow_Cursor(win, _HCURSORVal(aCursorId));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9812
#if 1
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9813
	GetCursorPos(&p);
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9814
	if (WindowFromPoint(p) == win)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9815
	{
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9816
	   PostMessage(win,WM_THREADSETCURSOR,0,(INT)_HCURSORVal(aCursorId));
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9817
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9818
#else
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9819
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9820
	 * if the pointer is currently in that window ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9821
	 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9822
	GetCursorPos(&p);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9823
	if (1/*WindowFromPoint(p) == win*/)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9824
	{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9825
	   SetCursor(_HCURSORVal(aCursorId));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9826
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9827
#endif
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9828
	RETURN ( self );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9829
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9830
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9831
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9832
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9833
setIconName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9834
    "define a windows iconname"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9835
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9836
%{  /* xxLIMITEDSTACK (WIN95 only) */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9837
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9838
    if (__isExternalAddress(aWindowId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9839
     && (__isString(aString) || __isSymbol(aString))) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9840
	HWND win = _HWNDVal(aWindowId);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9841
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9842
	SetWindowText(win, __stringVal(aString));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9843
	RETURN (self);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9844
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9845
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9846
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9847
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9848
setSaveUnder:yesOrNo in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9849
    "turn on/off save-under for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9850
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9851
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9852
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9853
setTransient:aWindowId for:aMainWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9854
    "set aWindowId to be a transient of aMainWindow"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9855
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9856
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9857
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9858
setWindowBackground:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9859
    "set the windows background color. This is the color with which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9860
     the view is filled whenever exposed. Do not confuse this with
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9861
     the background drawing color, which is used with opaque drawing."
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9862
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9863
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9864
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9865
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9866
     && (__isSmallInteger(aColorIndex))) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9867
	HWND hWnd = _HWNDVal(aWindowId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9868
	/*HBRUSH hBrush = CreateSolidBrush(st2RGB(__intVal(aColorIndex),0));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9869
	if (GetWindow_bgBrush(hWnd))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9870
	  DelObject(GetWindow_bgBrush(hWnd));*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9871
	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
  9872
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9873
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9874
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9875
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9876
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9877
setWindowBackgroundPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9878
    "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
  9879
     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
  9880
     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
  9881
     with opaque drawing."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9882
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9883
%{  /* NOCONTEXT */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9884
    DPRINTF(("setWindowBackgroundPixmap:in: not yet implemented\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9885
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9886
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9887
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9888
setWindowBorderColor:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9889
    "set the windows border color"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9890
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9891
%{  /* NOCONTEXT */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9892
    DPRINTF(("setWindowBorderColor:in: not yet implemented\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9893
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9894
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9895
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9896
setWindowBorderPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9897
    "set the windows border pattern"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9898
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9899
%{  /* NOCONTEXT */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9900
    DPRINTF(("setWindowBorderPixmap:in: not yet implemented\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9901
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9902
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9903
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9904
setWindowBorderWidth:aNumber in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9905
    "set the windows border width"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9906
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9907
%{  /* NOCONTEXT */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9908
    DPRINTF(("setWindowBorderWidth:in: not yet implemented\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9909
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9910
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9911
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9912
setWindowClass:wClass name:wName in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9913
    "define class and name of a window.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9914
     This may be used by the window manager to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9915
     select client specific resources."
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9916
%{  /* NOCONTEXT */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9917
    DPRINTF(("setWindowClass:name:in: not yet implemented\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9918
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9919
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9920
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9921
setWindowGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9922
    "set window gravity for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9923
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9924
%{  /* NOCONTEXT */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9925
    DPRINTF(("setWindowGravity:in: not yet implemented\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9926
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9927
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9928
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9929
setWindowIcon:aForm in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9930
    "define a bitmap to be used as icon"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9931
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9932
    |wiconId wiconHeight wiconWidth|
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9933
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9934
    aForm notNil ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9935
	wiconId := aForm id.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9936
	wiconHeight := aForm height.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9937
	wiconWidth  := aForm width.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9938
	self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9939
	    primSetWindowIconId:wiconId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9940
	    width:wiconWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9941
	    height:wiconHeight
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9942
	    in:aWindowId
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9943
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9944
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9945
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9946
setWindowIcon:aForm mask:aMaskForm in:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9947
    "set a windows icon & iconMask"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9948
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9949
%{  /* NOCONTEXT */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9950
    DPRINTF(("setWindowIcon:mask:in: not yet implemented\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9951
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9952
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9953
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9954
setWindowIconWindow:aView in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9955
    "define a window to be used as icon"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9956
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9957
    'setWindowIcon:in: not yet implemented' printCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9958
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9959
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9960
setWindowName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9961
    "define a windows name"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9962
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9963
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9964
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9965
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9966
     && (__isString(aString) || __isSymbol(aString))) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9967
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9968
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9969
	SetWindowText(win, __stringVal(aString));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9970
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9971
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9972
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9973
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9974
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9975
unmapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9976
    "make a window invisible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9977
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9978
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9979
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9980
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9981
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9982
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9983
	if (win) {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9984
	    CPRINTF(("unmapWindow %x\n",win));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9985
	    ShowWindow(win, SW_HIDE);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9986
	    CPRINTF(("unmapWindow1 %x\n",win));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9987
	    //enqEvent(win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9988
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9989
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9990
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9991
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9992
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9993
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9994
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9995
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9996
version
2331
71a2798c7413 md's out-of-view pointer-leave fixes (when grabbed)
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  9997
    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.60 1998-09-11 17:21:38 cg Exp $'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9998
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9999
WinWorkstation initialize!